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: Cannot use 'import.meta' outside a module #219

Closed
hoangmirs opened this issue Sep 11, 2023 · 0 comments · Fixed by #221
Closed

Fix: Cannot use 'import.meta' outside a module #219

hoangmirs opened this issue Sep 11, 2023 · 0 comments · Fixed by #221
Labels
type : bug Something isn't working

Comments

@hoangmirs
Copy link
Collaborator

Issue

  • We had an issue updating Oclif in this PR, so from 1.5.0, the CLI did not work when downloading from NPM registry:
❯ nimble-infra generate demo-project
/Users/local/.asdf/installs/nodejs/18.12.1/lib/node_modules/@nimblehq/infra-template/bin/run:9
  await oclif.execute({ type: 'cjs', dir: import.meta.url });
                                                 ^^^^

SyntaxError: Cannot use 'import.meta' outside a module
    at Object.compileFunction (node:vm:360:18)
    at wrapSafe (node:internal/modules/cjs/loader:1088:15)
    at Module._compile (node:internal/modules/cjs/loader:1123:27)
    at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
    at Module.load (node:internal/modules/cjs/loader:1037:32)
    at Module._load (node:internal/modules/cjs/loader:878:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:23:47

Node.js v18.12.1

Expected

The CLI should work without any issues

Steps to reproduce

  1. npx @nimblehq/[email protected] generate demo-project
  2. Observe the result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type : bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant