Closed argent-smith closed 3 years ago
Upd: the latter was due to the project wasn't built. Now after re:build I get this:
⟩ yarn test
yarn run v1.22.10
$ retest client/**/*.bs.js
(node:2586) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use `node --trace-warnings ...` to show where the warning was created)
/Users/paul/Development/own/dryer/node_modules/rescript-test/src/Test.bs.js:3
import * as Curry from "@rescript/std/lib/es6/curry.js";
^^^^^^
SyntaxError: Cannot use import statement outside a module
at Object.compileFunction (node:vm:355:18)
at wrapSafe (node:internal/modules/cjs/loader:1022:15)
at Module._compile (node:internal/modules/cjs/loader:1056:27)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1121:10)
at Module.load (node:internal/modules/cjs/loader:972:32)
at Function.Module._load (node:internal/modules/cjs/loader:813:14)
at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:201:29)
at ModuleJob.run (node:internal/modules/esm/module_job:154:23)
at async Loader.import (node:internal/modules/esm/loader:166:24)
at async file:///Users/paul/Development/own/dryer/node_modules/rescript-test/bin/retest.mjs:19:30
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
@argent-smith Yup, that's due to Node's way of managing modules, you need to use the .mjs
extension.
Fixed this by installing Babel et al. and switching to "commonjs" output. Thanx for the tool anyway )) Now it works and makes my sex better ))
Hi, I'm trying to run the tests but getting this:
My package.json:
My bsconfig.json:
What am I doing wrong?