3

I have the next environment working with Yarn workspaces:

System:
    OS: macOS Mojave 10.14.6
    CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
  Binaries:
    Node: 12.14.1 - /usr/local/bin/node
    Yarn: 1.21.1 - /usr/local/bin/yarn
    npm: 6.13.4 - /usr/local/bin/npm

I'm trying to fix the next error:

enter image description here

As you can see, I have 3 options to solve my problem, but I'm using Stenciljs and I found many solutions for babel.js and their babel.config.js file as you can see in the following link

But in Stenciljs I don't have babel.js set and the tests are set to the "testing" key of the stencil.config.ts file, I did the following configuration:

testing: {
  transformIgnorePatterns: ['<rootDir>/node_modules/'],
},

But I can't solve my problem. Anyone else has happened?

skyboyer
  • 22,209
  • 7
  • 57
  • 64
Luis
  • 2,006
  • 5
  • 31
  • 47
  • Is the code that causes the error (`export * from './theme'`) your own code or from a dependency? Also, which Stencil version are you encountering this with? – Simon Hänisch Feb 10 '20 at 23:08
  • I have a similar problem with the dist folder. My solution was to add the dist target into stencil.config.ts and so stencil seems to repair the config intern. – Huluvu424242 Jul 12 '20 at 15:20

1 Answers1

0

I was able to solve the problem, but it didn't have much to do with Stencil or Jest, but with Rollup and Typescript.

Among the packages generated by Rollup were the following:

index.es.js
index.js

But in my Rollup configuration I only mapped the creation of the index.es.js file. Why was the index.js file being generated? (which Jest read by default and got that error). The problem was that in my package.json file I had the following script:

"build": "rimraf dist / * && rollup -c && tsc"

What I did was remove && tsc and stopped generating the index.js file. With this I was able to run my tests without any problem.

I hope this helps someone else.

Luis
  • 2,006
  • 5
  • 31
  • 47