react-ts-lib icon indicating copy to clipboard operation
react-ts-lib copied to clipboard

Issue building after fresh clone/install

Open tmadison-gpsw opened this issue 3 years ago • 2 comments

Node: 14.16.1

After cloning and installing node modules and running npm run build I get the following error:

[!] Error: Cannot find module 'postcss'
Require stack:
- /Users/tmadison/Dev/react-ts-lib/node_modules/rollup-plugin-postcss/dist/index.js
- /Users/tmadison/Dev/react-ts-lib/rollup.config.js
- /Users/tmadison/Dev/react-ts-lib/node_modules/rollup/dist/shared/loadConfigFile.js
- /Users/tmadison/Dev/react-ts-lib/node_modules/rollup/dist/bin/rollup

tmadison-gpsw avatar Sep 08 '21 18:09 tmadison-gpsw

i got same problem and checked the output of npm install, noticed that postcss plugin need peer dependency which need be installed manually so after npm install -D postcss tslib (tslib is a peer denpendency of @rollup/plugin-typescript) i built it but it seems like rollup did not process css file and no css file was bundled to dist dir

update

i checked bundled js file and found that imported css file was converted to a string variable in bundled js, so it works well

leviathan-n avatar Sep 10 '21 06:09 leviathan-n

Even after installing missing packages the build fails on the last job of generating types:

src/index.ts → dist/cjs/index.js, dist/esm/index.js...
created dist/cjs/index.js, dist/esm/index.js in 896ms

dist/esm/types/index.d.ts → dist/index.d.ts...
[!] Error: Could not resolve entry module (dist/esm/types/index.d.ts).

pawelkrystkiewicz avatar Sep 24 '22 11:09 pawelkrystkiewicz