Replies: 8 comments 10 replies
-
Ok so I compared the generated configs from js:lib and node:lib and what seems to help is adding a
So now I'm wondering if it's a bug in js:lib generator. |
Beta Was this translation helpful? Give feedback.
-
+1 Adding .babelrc file with |
Beta Was this translation helpful? Give feedback.
-
Same issue, using some common libraries between a NestJS API and React app. The .babelrc tweaks mentioned in this thread initially gave me some nasty webpack errors and I realised one of the libraries was referencing a NodeJS package, so split out the common types and the issue is now sorted. Very frustrating since I was already re-exporting types and consuming the same libraries for weeks now, I just expanded the type exports a little and the house of cards fell over today. Here's a quick sample of the errors I saw before splitting up the NodeJS dependent library:
I'm still seeing the 2 warnings at the top, which are weird but don't seem to be breaking the build right now. |
Beta Was this translation helpful? Give feedback.
-
I'm facing this issue too, I'm importing a buildable library generated using |
Beta Was this translation helpful? Give feedback.
-
I too have stumbled into this and no workarounds are working. Basically when i build or run the app, all of the libraries are re-interpreted (in spite of having already built them separately) and they seem to be interpreted with a javascript compiler. When not complaining about flow it gripes about missing ; or , and the like, any time it runs into the : that specifies the type onto param or variable somewhere. (all libraries were react:lib, and this used rollup for the bundling). I'm on 15.6.3 so I presume I have the latest patches. I just started this nx project (my older lerna/storybook setup was out of date and i couldn't get js upgrades to work because of incompatibilities i got sick of arguing with). I finally got all the things 'green' in the editor and the libs are able to build, but the app is hitting this every time it tries to reference a file from one of the libs. |
Beta Was this translation helpful? Give feedback.
-
so this problem seems to be already fixed but i still stumble on it because i created my js/lib first and later a created a react/app, so the js/lib doesn't have a babelrc. the solution seems to recreate the js/lib using the flag "includeBabelRc" but it is an easy mistake to do if you are new into NX. Issue: #8793 |
Beta Was this translation helpful? Give feedback.
-
It looks like the web babel loader doesn't understand it tries to compile typescript (maybe it's expected to use already built lib's js files from dist and it doesn't for some reason?)
Also, the web:app consuming node:lib works just fine.
The errors are like this:
Beta Was this translation helpful? Give feedback.
All reactions