ionic-team / stencil-ds-plugins-demo

This is a demo project using the stencil-ds-plugins.
MIT License
44 stars 20 forks source link

TS2307: Cannot find module 'component-library' - Build fail on Windows 10 #10

Open peterennis opened 4 years ago

peterennis commented 4 years ago

@adamdbradley @mhartington

Related #5

Install rimraf to build react library on Windows 10.

Repo: https://github.com/peterennis/stencil-ds-plugins-demo/tree/ae-test

This commit: https://github.com/peterennis/stencil-ds-plugins-demo/commit/c164430e922f5462a2e6492faef998cb4dc575e3

This result:

Capture761

I have tried with some other experiments and get the same result. It seems related to Windows. Upgrading stencil did not help.

mhartington commented 4 years ago

Chances are this is due to the mono-repo setup, since the packages are not linked.

git clone <repo>
npm install
npx lerna bootstrap

there's some quirks here and there though, specifically with symlinks and webpack

peterennis commented 4 years ago

@mhartington I will try that and report back. Thanks.

peterennis commented 4 years ago

@mhartington

9 high severity vulnerabilities, a deprecated warning, but down to 1 error

src/components.ts:7:54 - error TS2307: Cannot find module 'component-libraryloader'. 7 import { defineCustomElements, applyPolyfills } from 'component-library\loader';

This deprecated warning:

node-resolve: setting options.module is deprecated, please override options.mainFields instead

New repo here: https://github.com/adaept/stencil-ds-plugins-demo

This commit: https://github.com/adaept/stencil-ds-plugins-demo/commit/db169686141c6c3df9649d359f8ec62e29d5c53b

found 9 high severity vulnerabilities in 43755 scanned packages
  run `npm audit fix` to fix 9 of them.

C:\ae\stencil-ds-plugins-demo>npx lerna bootstrap
lerna notice cli v3.18.3
lerna info versioning independent
lerna info Bootstrapping 5 packages
lerna info Installing external dependencies
lerna info Symlinking packages and binaries
lerna success Bootstrapped 5 packages

C:\ae\stencil-ds-plugins-demo>cd C:\ae\stencil-ds-plugins-demo\packages\component-library

C:\ae\stencil-ds-plugins-demo\packages\component-library>npm run build --prod

> component-library@0.0.1 build C:\ae\stencil-ds-plugins-demo\packages\component-library
> stencil build --docs

[02:29.4]  @stencil/core v1.7.5
[02:30.3]  build, demo, prod mode, started ...
[02:30.3]  transpile started ...
[02:33.0]  transpile finished in 2.63 s
[02:33.0]  type checking started ...
[02:33.0]  copy started ...
[02:33.0]  generate styles started ...
[02:33.0]  generate webcomponents module started ...
[02:33.0]  copy finished (0 files) in 27 ms
[02:33.3]  generate styles finished in 250 ms
[02:33.8]  generating angular-library started ...
[02:33.8]  generating react-library started ...
[02:33.8]  updated readme docs: demo-component
[02:33.8]  generate angular-library finished in 51 ms
[02:33.9]  generate react-library finished in 130 ms
[02:36.0]  generate webcomponents module finished in 2.98 s
[02:36.0]  bundling components started ...
[02:42.5]  bundling components finished in 6.47 s
[02:42.6]  type checking finished in 9.61 s
[02:42.8]  build finished in 12.49 s

C:\ae\stencil-ds-plugins-demo\packages\component-library>cd C:\ae\stencil-ds-plugins-demo\packages\component-library-angular

C:\ae\stencil-ds-plugins-demo\packages\component-library-angular>npm run build --prod

> component-library-angular@0.0.1 build C:\ae\stencil-ds-plugins-demo\packages\component-library-angular
> npm run build.ng

> component-library-angular@0.0.1 build.ng C:\ae\stencil-ds-plugins-demo\packages\component-library-angular
> npm run build.es2015 && npm run build.es5

> component-library-angular@0.0.1 build.es2015 C:\ae\stencil-ds-plugins-demo\packages\component-library-angular
> ngc -p tsconfig.json && rollup --config ./scripts/rollup.config.js

node-resolve: setting options.module is deprecated, please override options.mainFields instead

build/es2015/core.js → dist/fesm2015.js...
created dist/fesm2015.js in 146ms

> component-library-angular@0.0.1 build.es5 C:\ae\stencil-ds-plugins-demo\packages\component-library-angular
> ngc -p tsconfig.legacy.json && rollup --config ./scripts/rollup.config.legacy.js

node-resolve: setting options.module is deprecated, please override options.mainFields instead

build/es5/core.js → dist/fesm5.js...
created dist/fesm5.js in 128ms

C:\ae\stencil-ds-plugins-demo\packages\component-library-angular>cd C:\ae\stencil-ds-plugins-demo\packages\component-library-react

C:\ae\stencil-ds-plugins-demo\packages\component-library-react>npm run build --prod

> component-library-react@0.0.1 build C:\ae\stencil-ds-plugins-demo\packages\component-library-react
> npm run clean && npm run compile

> component-library-react@0.0.1 clean C:\ae\stencil-ds-plugins-demo\packages\component-library-react
> rimraf dist

> component-library-react@0.0.1 compile C:\ae\stencil-ds-plugins-demo\packages\component-library-react
> npm run tsc

> component-library-react@0.0.1 tsc C:\ae\stencil-ds-plugins-demo\packages\component-library-react
> tsc -p .

src/components.ts:7:54 - error TS2307: Cannot find module 'component-libraryloader'.

7 import { defineCustomElements, applyPolyfills } from 'component-library\loader';
                                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~

Found 1 error.

npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! component-library-react@0.0.1 tsc: `tsc -p .`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the component-library-react@0.0.1 tsc script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\peter\AppData\Roaming\npm-cache\_logs\2019-12-19T04_04_22_801Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! component-library-react@0.0.1 compile: `npm run tsc`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the component-library-react@0.0.1 compile script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\peter\AppData\Roaming\npm-cache\_logs\2019-12-19T04_04_22_879Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! component-library-react@0.0.1 build: `npm run clean && npm run compile`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the component-library-react@0.0.1 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\peter\AppData\Roaming\npm-cache\_logs\2019-12-19T04_04_22_936Z-debug.log

C:\ae\stencil-ds-plugins-demo\packages\component-library-react>

Capture763