You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First run npm run dev and you'll not get the error, then run npm run build && npm start and you'll get it.
Describe the bug
When importing from a CommonJS module with this syntax: import { method } from 'module';, it works fine in development but it breaks on production.
Additional context
No response
Logs
[nuxt] [request error] [unhandled] [500] Named export'captureException' not found. The requested module '@sentry/vue' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:
import pkg from '@sentry/vue';
const { captureException } = pkg;
at async eval (./.output/server/chunks/handlers/renderer.mjs:11115:24)
at async eval (./.output/server/chunks/handlers/renderer.mjs:11169:64)
at async eval (./.output/server/chunks/handlers/renderer.mjs:33:22)
at async eval (./.output/server/node_modules/h3/dist/index.mjs:571:19)
The text was updated successfully, but these errors were encountered:
@huang-julien I just tried and it doesn't throw the error if I transpile it. Anyway, I think it shouldn't work differently in development and production, or the transpile should be automatic.
Environment
Linux
v16.14.2
3.0.0-rc.8
npm@7.17.0
vite
vite
-
-
Reproduction
https://stackblitz.com/edit/github-c5nszx?file=package.json
First run
npm run dev
and you'll not get the error, then runnpm run build && npm start
and you'll get it.Describe the bug
When importing from a CommonJS module with this syntax:
import { method } from 'module';
, it works fine in development but it breaks on production.Additional context
No response
Logs
The text was updated successfully, but these errors were encountered: