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

javascript-obfuscator/test/index.spec.ts:1 import 'reflect-metadata'; SyntaxError: Cannot use import statement outside a module #1253

Open
macoomac opened this issue May 13, 2024 · 1 comment

Comments

@macoomac
Copy link

Expected Behavior

Current Behavior

Steps to Reproduce

1.git clone https://github.com/javascript-obfuscator/javascript-obfuscator.git
2.npm install --save-dev javascript-obfuscator
3.npm run build
4.ob/javascript-obfuscator/test/index.spec.ts:1
import 'reflect-metadata';
^^^^^^

SyntaxError: Cannot use import statement outside a module
at internalCompileFunction (node:internal/vm:73:18)
at wrapSafe (node:internal/modules/cjs/loader:1187:20)
at Module._compile (node:internal/modules/cjs/loader:1231:27)
at Module.replacementCompile (/work/jsdync/ob/javascript-obfuscator/node_modules/append-transform/index.js:60:13)
at module.exports (/work/jsdync/ob/javascript-obfuscator/node_modules/default-require-extensions/js.js:7:9)
at Object. (/work/jsdync/ob/javascript-obfuscator/node_modules/append-transform/index.js:64:4)
at Module.load (node:internal/modules/cjs/loader:1125:32)
at Function.Module._load (node:internal/modules/cjs/loader:965:12)
at ModuleWrap. (node:internal/modules/esm/translators:165:29)
at ModuleJob.run (node:internal/modules/esm/module_job:192:25)
error Command failed with exit code 1.

Your Environment

  • Obfuscator version used:
  • Node version used:

Stack trace

Minimal working example that will help to reproduce issue

@macoomac
Copy link
Author

Your Environment
Obfuscator version used: 4.1.0
Node version used: v20.0.0

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

No branches or pull requests

1 participant