Closed jolic closed 2 years ago
Which version do you use?
< 2.0.0
, tests are written in TypeScript. It means that you need sth like ts-jest
.> 2.0.0
, there is no tests yet (they have been transferred to the main repo pin-field
), so it should pass without any problem.I'm using 2.0.0-beta.2
I'm now using another package.
it should pass without any problem.
Except that it doesn't. I am also using 2.0.0-beta.2. Does that count as greater than or less than 2.0.0
here? I am getting the same error as the OP. Downgraded to 1.1.0, tests are passing.
I'm using craco and the tests of the app works until I added react-pin-field:
at Runtime.createScriptFromCode (node_modules/jest-runtime/build/index.js:1350:14) at Object.<anonymous> (node_modules/react-pin-field/dist/react-pin-field.cjs.development.js:6:16)
If I follow the error, it fails on this line:
var pinField = require('@soywod/pin-field');
Did you install @soywod/pin-field
? Since the v2.0.0-beta.0
, react-pin-field
depends on it so it needs to be installed (see the CHANGELOG).
I did install it. I still get: SyntaxError: Unexpected token 'export'
Hm. It's really strange, because node_modules/react-pin-field/dist/react-pin-field.cjs.development.js
does not contain any export
(since it is a CJS build), so how come you get SyntaxError: Unexpected token 'export'
? Could you try to set up a repo that reproduces this bug (so I can investigate a bit more)?
The native web component was a big mistake, it led to so many issues… I ended up rolling back to v1
state, without web component (pure React implementation). The issue should be fixed starting from the v3.0.11
.
I'm using craco and the tests of the app works until I added react-pin-field:
` SyntaxError: Unexpected token 'export'
`
How to solve this?