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

fix: get vue version in esm version #481

Merged
merged 1 commit into from
Aug 8, 2022
Merged

fix: get vue version in esm version #481

merged 1 commit into from
Aug 8, 2022

Conversation

sxzz
Copy link
Member

@sxzz sxzz commented Aug 8, 2022

Description

When "type": "module", require is not working.

Linked Issues

Additional context

@sxzz sxzz requested a review from antfu as a code owner August 8, 2022 06:33
@antfu antfu merged commit 0629357 into main Aug 8, 2022
@antfu antfu deleted the fix/vue-version branch August 8, 2022 07:30
@Codermar
Copy link

Codermar commented Aug 8, 2022

I am getting errors in a vue 2 and a vue 3 Vite based projects after this patch:

[dev:client] failed to load config from /usr/local/apple/okapi-admin-app-next/vite.config.ts
[dev:client] error when starting dev server:
[dev:client] /usr/local/apple/okapi-admin-app-next/node_modules/.pnpm/unplugin-vue-components@0.22.1_sus6ti7jdtftlu3mdsmbws62ua/node_modules/unplugin-vue-components/dist/chunk-T7EPVSRW.js:107
[dev:client] var _require = _module.createRequire.call(void 0, import.meta.url);
[dev:client]                                                          ^^^^
[dev:client]
[dev:client] SyntaxError: Cannot use 'import.meta' outside a module
[dev:client]     at Object.compileFunction (node:vm:352:18)
[dev:client]     at wrapSafe (node:internal/modules/cjs/loader:1033:15)
[dev:client]     at Module._compile (node:internal/modules/cjs/loader:1069:27)
[dev:client]     at Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
[dev:client]     at Object._require.extensions.<computed> [as .js] (file:///usr/local/apple/okapi-admin-app-next/node_modules/.pnpm/vite@3.0.4/node_modules/vite/dist/node/chunks/dep-71eb12cb.js:62910:17)
[dev:client]     at Module.load (node:internal/modules/cjs/loader:981:32)
[dev:client]     at Function.Module._load (node:internal/modules/cjs/loader:822:12)
[dev:client]     at Module.require (node:internal/modules/cjs/loader:1005:19)
[dev:client]     at require (node:internal/modules/cjs/helpers:102:18)
[dev:client]     at Object.<anonymous> (/usr/local/apple/okapi-admin-app-next/node_modules/.pnpm/unplugin-vue-components@0.22.1_sus6ti7jdtftlu3mdsmbws62ua/node_modules/unplugin-vue-components/dist/vite.js:3:24)
[dev:client]  ELIFECYCLE  Command failed with exit code 1.
[dev:client] pnpm run dev:client exited with code 1
--> Sending SIGTERM to other processes..
[dev:server:watch:mock] pnpm run dev:server:watch:mock exited with code 0
 ELIFECYCLE  Command failed with exit code 1.```

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

Successfully merging this pull request may close these issues.

None yet

3 participants