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

superset-frontend ReferenceError: module is not defined #28557

Open
3 tasks done
tym3515 opened this issue May 17, 2024 · 3 comments
Open
3 tasks done

superset-frontend ReferenceError: module is not defined #28557

tym3515 opened this issue May 17, 2024 · 3 comments

Comments

@tym3515
Copy link

tym3515 commented May 17, 2024

Bug description

npm run dev-server

module is not defined
ReferenceError: module is not defined
at eval (webpack-internal:///./packages/superset-ui-core/node_modules/micromark-extension-gfm-autolink-literal/dev/lib/syntax.js:6:151)
at eval (webpack-internal:///./packages/superset-ui-core/node_modules/micromark-extension-gfm-autolink-literal/dev/lib/syntax.js:6:161)
at ./packages/superset-ui-core/node_modules/micromark-extension-gfm-autolink-literal/dev/lib/syntax.js (http://localhost:9000/static/assets/vendors-node_modules_ant-design_icons_es_components_Icon_js-node_modules_ant-design_icons_es_-ee1f88.05bed6d2.entry.js:29051:1)
at webpack_require (http://localhost:9000/static/assets/spa.52592bdf.entry.js:1931:33)
at fn (http://localhost:9000/static/assets/spa.52592bdf.entry.js:2264:21)
at eval (webpack-internal:///./packages/superset-ui-core/node_modules/micromark-extension-gfm/index.js:6:98)
at ./packages/superset-ui-core/node_modules/micromark-extension-gfm/index.js (http://localhost:9000/static/assets/vendors-node_modules_ant-design_icons_es_components_Icon_js-node_modules_ant-design_icons_es_-ee1f88.05bed6d2.entry.js:29183:1)
at webpack_require (http://localhost:9000/static/assets/spa.52592bdf.entry.js:1931:33)
at fn (http://localhost:9000/static/assets/spa.52592bdf.entry.js:2264:21)
at eval (webpack-internal:///./packages/superset-ui-core/node_modules/remark-gfm/index.js:4:81)

How to reproduce the bug

npm install

npm run dev-server

Screenshots/recordings

2024517111348778

Superset version

3.1.3

Python version

3.9

Node version

18 or greater

Browser

Chrome

Additional context

No response

Checklist

  • I have searched Superset docs and Slack and didn't find a solution to my problem.
  • I have searched the GitHub issue tracker and didn't find a similar bug report.
  • I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
Copy link

dosubot bot commented May 17, 2024

The error you're encountering with superset-frontend and the micromark-extension-gfm-autolink-literal package seems to be a module resolution issue. Here's a more focused approach to troubleshoot and potentially resolve this problem:

  1. Node.js Version: Ensure your Node.js version (18 or greater) fully supports ES modules. The error could stem from incompatibilities or misconfigurations related to module handling.

  2. Check Installation: Run npm install or yarn install to make sure all dependencies, including sub-dependencies like micromark-extension-gfm-autolink-literal, are correctly installed.

  3. Babel Configuration: If you're using Babel, verify your configuration to ensure ES modules are correctly transpiled. Including plugins such as @babel/plugin-transform-modules-commonjs might be necessary.

  4. Webpack Configuration: For projects using Webpack, adjust your configuration to properly resolve ES modules by setting resolve.mainFields to ['browser', 'module', 'main'].

  5. Direct Dependency Installation: As a workaround, try installing micromark-extension-gfm-autolink-literal directly in your project (npm install micromark-extension-gfm-autolink-literal or yarn add micromark-extension-gfm-autolink-literal).

  6. Research and Updates: Check the GitHub repositories for micromark-extension-gfm-autolink-literal, react-markdown, remark-gfm, or @superset-ui/core for any known issues or updates that might address this problem.

For further assistance, providing more details about your setup, including the exact Node.js version, Webpack configuration, and any additional console output, would be helpful.

Details

Sources


About Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

To continue the conversation, mention @dosu.

@rusackas
Copy link
Member

Hopefully the bot's right, that an npm install will fix it. You can delete the node modules folder and then npm install (or just npm ci) if you want to be extra sure.

@harrychristianx
Copy link

I tried npm install, npm ci on superset-frontend directory but the error still persists. I experimented with clean installing superset-ui-core by deleting the node_modules and having npm ci still error shows. This goes for both 4.0.0 and 4.0.1 releases on superset.

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

3 participants