Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempted import error: 'embed' is not exported from '@nebula.js/stardust' (imported as 'embed') #1635

Open
danverbs opened this issue Oct 28, 2024 · 5 comments
Assignees

Comments

@danverbs
Copy link

🐛 Bug report

I'm trying to implement nebula in my NextJs 14 app but I cannot get the package to run at all I keep getting this error:

Attempted import error: 'embed' is not exported from '@nebula.js/stardust' (imported as 'embed')

Steps to Reproduce

  • clean nextjs project (npx create-next-app@14.2.16 - which is on React v18)
  • i have a qlik-context wrapping the app with an enigma + ticket auth connection which works
  • create a client-side component to import and create a nebula chart

Expected behavior

I've used the same process using a non-NextJs app (React v17) which works fine

Is this an issue with Next, React version or something else?

@danverbs
Copy link
Author

Just an extra note - if I run this with turbopack '--turbo' added to the dev script, it runs fine and the chart renders as expected. Without --turbo it doesn't load at all

@danverbs
Copy link
Author

I've managed to narrow down the latest working version in our project. We're using Next so having to dynamically import the libraries so we don't get any client-side requirement errors:

        const { embed } = await import('@nebula.js/stardust');
        const barChart = (await import('@nebula.js/sn-bar-chart')).default;

Everything works up to v4.2.4, however every version from v4.3.0 onwards gives us the Attempted import error: 'embed' is not exported from '@nebula.js/stardust' error

Were there any changes to the embed import we need to be aware of/implement a change in how we import?

Other things we tried:
-importing from '@nebula.js/stardust/dist/stardust' gets rid of the error but then the barchart obviously breaks
-running nextjs in turbopack 'next dev --turbo' seems to work but it breaks on build

Are there plans to make this nextjs compatible?

Happy to discuss/share code as needed

@Caele
Copy link
Collaborator

Caele commented Nov 23, 2024

Hello, sorry for not answering sooner.
From what I can see in the diff (here) we didn't do anything that would explain the issue you are seeing. Its mostly dependency updates, so my guess is that one of them is the culprit.
We'll see if we can reproduce this, haven't used next.js myself but if it fails with a base setup we'll make do. If you can share a codesandbox (or similar) setup, even better.

@Caele Caele self-assigned this Nov 23, 2024
@Caele
Copy link
Collaborator

Caele commented Nov 25, 2024

I did a test run now with a bare-bones next.js app, no issues from what I can see when simply runnig it.

@danverbs
Copy link
Author

danverbs commented Dec 2, 2024

That's interesting... I'll see if I can get something reproducible in a sandbox

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants