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

Error building react-lib in Stencil-toolkit-nx repo #52

Closed
bellindj opened this issue Jan 8, 2020 · 4 comments
Closed

Error building react-lib in Stencil-toolkit-nx repo #52

bellindj opened this issue Jan 8, 2020 · 4 comments

Comments

@bellindj
Copy link

bellindj commented Jan 8, 2020

Thanks so much for creating the stencil-toolkit plugin for NX! I am running the stencil-toolkit-nx project under integrations and facing an issue building the react-lib.

Steps:
clone repo
cd integration/stencil-toolkit-nx
edit package.json, change "@aiao/stencil-toolkit": "file:../../dist/libs/stencil-toolkit", to "@aiao/stencil-toolkit": "0.0.10",
yarn
ng build stencil-lib - works fine
ng build angular-lib - works fine
`ng build react-lib' - gives the below error:

CINMAC12801:stencil-toolkit-nx dan$ ng build react-lib
Bundling...
{ Error: /Users/dan/aiao/integration/stencil-toolkit-nx/libs/react-lib/src/lib/react-component-lib/createOverlayComponent.tsx(15,17): semantic error TS2742: The inferred type of 'createOverlayComponent' cannot be named without a reference to 'react-dom/node_modules/@types/react'. This is likely not portable. A type annotation is necessary.
at error (/Users/dan/aiao/integration/stencil-toolkit-nx/node_modules/@nrwl/web/node_modules/rollup/dist/rollup.js:9419:30)
at throwPluginError (/Users/dan/aiao/integration/stencil-toolkit-nx/node_modules/@nrwl/web/node_modules/rollup/dist/rollup.js:15699:12)
at Object.error (/Users/dan/aiao/integration/stencil-toolkit-nx/node_modules/@nrwl/web/node_modules/rollup/dist/rollup.js:15754:24)
at Object.error (/Users/dan/aiao/integration/stencil-toolkit-nx/node_modules/@nrwl/web/node_modules/rollup/dist/rollup.js:16146:38)
at RollupContext.error (/Users/dan/aiao/integration/stencil-toolkit-nx/node_modules/@nrwl/web/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:17194:30)
at lodash_3 (/Users/dan/aiao/integration/stencil-toolkit-nx/node_modules/@nrwl/web/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:24958:23)
at arrayEach (/Users/dan/aiao/integration/stencil-toolkit-nx/node_modules/@nrwl/web/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:534:11)
at forEach (/Users/dan/aiao/integration/stencil-toolkit-nx/node_modules/@nrwl/web/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:9360:14)
at printDiagnostics (/Users/dan/aiao/integration/stencil-toolkit-nx/node_modules/@nrwl/web/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:24931:5)
at cache.getCompiled (/Users/dan/aiao/integration/stencil-toolkit-nx/node_modules/@nrwl/web/node_modules/rollup-plugin-typescript2/dist/rollup-plugin-typescript2.cjs.js:27356:21)
id:
'/Users/dan/aiao/integration/stencil-toolkit-nx/libs/react-lib/src/lib/react-component-lib/createOverlayComponent.tsx',
hook: 'transform',
code: 'PLUGIN_ERROR',
plugin: 'rpt2' }
'@stencil-toolkit-nx/stencil-lib/loader' is imported by libs/react-lib/src/lib/proxies.ts, but could not be resolved – treating it as an external dependency
'@stencil-toolkit-nx/stencil-lib/loader' is imported by libs/react-lib/src/lib/proxies.ts, but could not be resolved – treating it as an external dependency
'@stencil-toolkit-nx/stencil-lib/loader' is imported by libs/react-lib/src/lib/proxies.ts, but could not be resolved – treating it as an external dependency
No name was provided for external module '@stencil-toolkit-nx/stencil-lib/loader' in output.globals – guessing 'loader'

Is that project building for you?

@Jimmysh Jimmysh closed this as completed in 4bddf64 Jan 9, 2020
@Jimmysh
Copy link
Member

Jimmysh commented Jan 9, 2020

@bellindj
need clean stencil output files.
https://github.com/aiao-io/aiao/blob/master/integration/stencil-toolkit-nx/libs/stencil-lib/scripts/build-clean.js

You can use yarn build:libs build all libs.

@bellindj
Copy link
Author

bellindj commented Jan 9, 2020

That worked, thanks so much for the instructions and your commit!

@Jimmysh
Copy link
Member

Jimmysh commented Feb 17, 2020

@bellindj
Copy link
Author

@Jimmysh great thanks for including me on this for visibility! I haven’t pulled the latest in a bit but will do that.

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

2 participants