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

"vue_runtime_esm_default" value is nested as "default" when vue moudle deps by both ESM and CJS. #1701

Closed
2 of 3 tasks
songbug1024 opened this issue Jan 25, 2021 · 3 comments

Comments

@songbug1024
Copy link

songbug1024 commented Jan 25, 2021

  • Read the docs.
  • Use Vite >=2.0. (1.x is no longer supported)
  • If the issue is related to 1.x -> 2.0 upgrade, read the Migration Guide first.

Describe the bug

"vue_runtime_esm_default" value is nested as "default" when vue moudle deps by both ESM and CJS, below is some screenshots.

image
image
image

Reproduction

none

System Info

  • vite 2.0.0-beta.48
  • Operating System: Win 10 x64
  • Node version: v14.15.1
  • Package manager (npm/yarn/pnpm) and version: 6.14.8

Logs (Optional if provided reproduction)

vite:config bundled config file loaded in 632ms +0ms
vite:config using resolved config: {
vite:config base: '/vite/',
vite:config build: {
vite:config target: [ 'es2019', 'edge16', 'firefox60', 'chrome61', 'safari11' ],
vite:config polyfillDynamicImport: true,
vite:config outDir: 'dist',
vite:config assetsDir: 'assets',
vite:config assetsInlineLimit: 4096,
vite:config cssCodeSplit: true,
vite:config sourcemap: false,
vite:config rollupOptions: {},
vite:config commonjsOptions: { include: [Array], extensions: [Array] },
vite:config minify: 'terser',
vite:config terserOptions: {},
vite:config cleanCssOptions: {},
vite:config write: true,
vite:config emptyOutDir: null,
vite:config manifest: false,
vite:config lib: false,
vite:config ssr: false,
vite:config ssrManifest: false
vite:config },
vite:config plugins: [
vite:config 'vite:pre-alias',
vite:config 'alias',
vite:config 'vite:dynamic-import-polyfill',
vite:config 'vite:resolve',
vite:config 'vite:html',
vite:config 'vite:css',
vite:config 'vite:esbuild',
vite:config 'vite:json',
vite:config 'vite:wasm',
vite:config 'vite:worker',
vite:config 'vite:asset',
vite:config 'vite-plugin-vue2',
vite:config 'vite:style-import',
vite:config 'vite:css-post',
vite:config 'vite:client-inject',
vite:config 'vite:import-analysis'
vite:config ],
vite:config optimizeDeps: { include: [], exclude: [] },
vite:config server: { hmr: { path: 'vite/' } },
vite:config configFile: 'D:/tuhushop/basic/my-vue-app/vite.config.ts',
vite:config inlineConfig: {
vite:config root: undefined,
vite:config base: undefined,
vite:config mode: undefined,
vite:config configFile: undefined,
vite:config logLevel: undefined,
vite:config clearScreen: undefined,
vite:config server: {}
vite:config },
vite:config root: 'D:/tuhushop/basic/my-vue-app',
vite:config command: 'serve',
vite:config mode: 'development',
vite:config isProduction: false,
vite:config optimizeCacheDir: 'D:\tuhushop\basic\my-vue-app\node_modules\.vite',
vite:config alias: [
vite:config {
vite:config find: /^/@vite//,
vite:config replacement: 'D:\tuhushop\basic\my-vue-app\node_modules\vite\dist\client/'
vite:config }
vite:config ],
vite:config env: { BASE_URL: '/vite/', MODE: 'development', DEV: true, PROD: false },
vite:config assetsInclude: [Function: assetsInclude],
vite:config logger: {
vite:config hasWarned: false,
vite:config info: [Function: info],
vite:config warn: [Function: warn],
vite:config error: [Function: error],
vite:config clearScreen: [Function: clearScreen]
vite:config }
vite:config } +5ms

@yyx990803
Copy link
Member

That's a known issue in esbuild, but there is runtime interop in Vite to handle this. So unless it breaks your code this is not a bug.

@songbug1024
Copy link
Author

That's a known issue in esbuild, but there is runtime interop in Vite to handle this. So unless it breaks your code this is not a bug.

Is there any reference document?

@yyx990803
Copy link
Member

evanw/esbuild#706

@github-actions github-actions bot locked and limited conversation to collaborators Jul 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants