question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

When running serve, an error occurs with the error message:Cannot use 'inmport.meta' outside a module

See original GitHub issue

Describe the bug

When running serve, an error occurs with the error message:Cannot use ‘inmport.meta’ outside a module image

Reproduction

When running serve, an error occurs with the error message:Cannot use ‘inmport.meta’ outside a module

System Info

npm run serve

Used Package Manager

npm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn’t already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:2
  • Comments:7

github_iconTop GitHub Comments

3reactions
tinawngcommented, Aug 8, 2022

Still present in 0.22.2 😢

C:\Users\Tina\work\Place\node_modules\unplugin-vue-components\dist\chunk-YPBVGE6A.js:110
var _require = typeof _chunkEZUCZHGVjs.__require === "undefined" ? _module.createRequire.call(void 0, import.meta.url) : _chunkEZUCZHGVjs.__require;
                                                                              
                               ^^^^

SyntaxError: Cannot use 'import.meta' outside a module
    at Object.compileFunction (node:vm:360:18)
    at wrapSafe (node:internal/modules/cjs/loader:1049:15)
    at Module._compile (node:internal/modules/cjs/loader:1084:27)
    at Module._extensions..js (node:internal/modules/cjs/loader:1174:10)      
    at _require.extensions.<computed> [as .js] (file:///C:/Users/Tina/work/Place/node_modules/vite/dist/node/chunks/dep-71eb12cb.js:62910:17)
    at Module.load (node:internal/modules/cjs/loader:998:32)
    at Module._load (node:internal/modules/cjs/loader:839:12)
    at Module.require (node:internal/modules/cjs/loader:1022:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (C:\Users\Tina\work\Place\node_modules\unplugin-vue-components\dist\vite.js:3:24)
3reactions
pablosebastianrcommented, Aug 8, 2022

y ahora qué rompieron ???

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Bug]: SyntaxError: Cannot use 'import.meta' outside a module ...
Hi there! import.meta is an ESM only feature and cannot be used in CJS (aka when using require ), so you need the ......
Read more >
Cannot use 'import.meta' outside a module - Stack Overflow
Need to get the current working directoy because I have resources in there that I need for the app to run. Need the...
Read more >
How to fix "cannot use import statement outside a module"
This error occurs for one reason: you're trying to use import and you're not inside an ES module. It can happen in a...
Read more >
Cannot use import statement outside a module' | HackerNoon
This error arises when we try to use import inside of a project which is not set up for modules - so let's...
Read more >
Cannot use import statement outside a module [React ...
This error might be raised when using either JavaScript or TypeScript in the back-end. So you could be working on the client side...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found