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

JavaScript Embed SDK - Module not found: Can't resolve '@superset-ui/switchboard' #22747

Closed
3 tasks done
c-kirkeby opened this issue Jan 17, 2023 · 5 comments
Closed
3 tasks done
Assignees
Labels
#bug Bug report

Comments

@c-kirkeby
Copy link

c-kirkeby commented Jan 17, 2023

When I attempt to use the @superset-ui/embedded-sdk library in a Next.js application, it

How to reproduce the bug

  1. git clone git@github.com:c-kirkeby/superset-miniral-reproduction.git
  2. pnpm install or npm install (it has lockfiles for both)
  3. pnpm run build or npm run build
  4. See the compile error in your terminal

Expected results

Compile without error

Actual results

❯ npm run build

> superset-minimal-reproduction@0.1.0 build
> next build

info  - Linting and checking validity of types  
info  - Creating an optimized production build  
Failed to compile.

./node_modules/@superset-ui/embedded-sdk/lib/index.js
Module not found: Can't resolve '@superset-ui/switchboard' in '/Users/christian/Projects/superset-minimal-reproduction/node_modules/@superset-ui/embedded-sdk/lib'

Import trace for requested module:
./node_modules/@superset-ui/embedded-sdk/lib/index.js


> Build failed because of webpack errors

Environment

(please complete the following information):

  • browser type and version: N/A
  • superset version: "@superset-ui/embedded-sdk": "0.1.0-alpha.8"
  • python version: N/A
  • node.js version: 18.13.0 (also does not work on 16.19.0)
  • any feature flags active:

Checklist

Make sure to follow these steps before submitting your issue - thank you!

  • I have checked the superset logs for python stacktraces and included it here as text if there are any. (Not applicable)
  • I have reproduced the issue with at least the latest released version of superset.
  • I have checked the issue tracker for the same issue and I haven't found one similar.

Additional context

I encountered this while upgrading a Next.js project's dependencies. We hadn't encountered this error previously.

I've also created a minimal reproduction repo with Vite to rule out Next.js being an issue:

https://github.com/c-kirkeby/superset-minimal-reproduction-vite

@c-kirkeby c-kirkeby added the #bug Bug report label Jan 17, 2023
@haivp3010
Copy link

haivp3010 commented Jan 17, 2023

Duplicate of #22683.
Could the latest version of @superset-ui/switchboard, i.e. v0.18.26-1 be published by mistake? As I could see the package has nothing inside other than the package.json file.
https://www.npmjs.com/package/@superset-ui/switchboard/v/0.18.26-1?activeTab=explore
image

The related release workflow can be found here, though failure to publish npm packages has been going on for some weeks I think
https://github.com/apache/superset/actions/runs/3840108687/jobs/6538761916#step:12:31

@c-kirkeby
Copy link
Author

Duplicate of #22683. Could the latest version of @superset-ui/switchboard, i.e. v0.18.26-1 be published by mistake? As I could see the package has nothing inside other than the package.json file. https://www.npmjs.com/package/@superset-ui/switchboard/v/0.18.26-1?activeTab=explore image

The related release workflow can be found here, though failure to publish npm packages has been going on for some weeks I think https://github.com/apache/superset/actions/runs/3840108687/jobs/6538761916#step:12:31

Apologies, that issue did not come up when I searched for it. The temporary fix mentioned in that ticket unfortunately won't work as our CI won't have pre-existing node_modules.

@haivp3010
Copy link

haivp3010 commented Jan 17, 2023

@c-kirkeby a workaround you could try is explicitly installing v1.5.0 of @superset-ui/switchboard (or v0.18.26-0 if you feel like it, but I could see 1.5.0 is latest before 0.18.26-1)

yarn add @superset-ui/switchboard@^1.5.0

@c-kirkeby
Copy link
Author

@c-kirkeby a workaround you could try is explicitly installing v1.5.0 of @superset-ui/switchboard (or v0.18.26-0 if you feel like it, but I could see 1.5.0 is latest before 0.18.26-1)

yarn add @superset-ui/switchboard@^1.5.0

Thanks, that helped! I was able to get around this for the time being by explicitly installing the previous version.

@rusackas
Copy link
Member

I believe this was all solved, and was a temporary problem. If anyone is experiencing this in the current version, we can revisit/reopen.

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

No branches or pull requests

4 participants