grid-js / gridjs

Advanced table plugin
https://gridjs.io
MIT License
4.39k stars 240 forks source link

Plugin folder fails to build when building from git. #1393

Open fabanc opened 11 months ago

fabanc commented 11 months ago

Describe the bug When installing from the git repository (not npm), the script npm run build fails. The error message is:

(rpt2 plugin) Error: D:/git/gridjs/plugins/selection/src/rowSelection/rowSelection.tsx(3,71): semantic error TS2307: Cannot find module 'gridjs' or its corresponding type declarations. Error: D:/git/gridjs/plugins/selection/src/rowSelection/rowSelection.tsx(3,71): semantic error TS2307: Cannot find module 'gridjs' or its corresponding type declarations.

To Reproduce Steps to reproduce the behavior:

  1. Clone the project from github: git clone https://github.com/grid-js/gridjs.git
  2. Move the terminal into the gridjs repository: cd gridjs
  3. Run the build command: npm run build
  4. See error
> gridjs@6.0.6 prebuild
> npm run clean

> gridjs@6.0.6 clean
> rimraf coverage dist tmp l10n/dist 'plugins/!(node_modules)/dist'

> gridjs@6.0.6 build
> run-p build:grid build:i18n build:plugins build:themes

> gridjs@6.0.6 build:grid
> microbundle build --raw --external none --tsconfig tsconfig.release.json

> gridjs@6.0.6 build:i18n
> microbundle build --raw --cwd l10n --tsconfig l10n/tsconfig.release.json

> gridjs@6.0.6 build:plugins
> microbundle build --raw --cwd plugins/selection --tsconfig plugins/selection/tsconfig.release.json

> gridjs@6.0.6 prebuild:themes
> sass src/theme/mermaid/index.scss dist/theme/mermaid.css

> gridjs@6.0.6 build:themes
> run-p build:themes-dev build:themes-prod

> gridjs@6.0.6 build:themes-dev
> postcss dist/theme/mermaid.css --output dist/theme/mermaid.css --env development --verbose

> gridjs@6.0.6 build:themes-prod
> postcss dist/theme/mermaid.css --output dist/theme/mermaid.min.css --env production --verbose

Processing dist\theme\mermaid.css...
Processing dist\theme\mermaid.css...
Browserslist: caniuse-lite is outdated. Please run:
  npx update-browserslist-db@latest
  Why you should do it regularly: https://github.com/browserslist/update-db#readme
Browserslist: caniuse-lite is outdated. Please run:
  npx update-browserslist-db@latest
  Why you should do it regularly: https://github.com/browserslist/update-db#readme
Finished dist\theme\mermaid.css in 440 ms
Finished dist\theme\mermaid.css in 744 ms
(rpt2 plugin) Error: D:/git/gridjs/plugins/selection/src/rowSelection/rowSelection.tsx(3,71): semantic error TS2307: Cannot find module 'gridjs' or its corresponding type declarations.
Error: D:/git/gridjs/plugins/selection/src/rowSelection/rowSelection.tsx(3,71): semantic error TS2307: Cannot find module 'gridjs' or its corresponding type declarations.
    at error (D:\git\gridjs\node_modules\rollup\dist\shared\rollup.js:198:30)
    at throwPluginError (D:\git\gridjs\node_modules\rollup\dist\shared\rollup.js:21718:12)
    at Object.error (D:\git\gridjs\node_modules\rollup\dist\shared\rollup.js:22672:20)
    at Object.error (D:\git\gridjs\node_modules\rollup\dist\shared\rollup.js:21895:42)
    at RollupContext.error (D:\git\gridjs\node_modules\rollup-plugin-typescript2\dist\rollup-plugin-typescript2.cjs.js:20259:30)
    at D:\git\gridjs\node_modules\rollup-plugin-typescript2\dist\rollup-plugin-typescript2.cjs.js:29527:23
    at Array.forEach (<anonymous>)
    at printDiagnostics (D:\git\gridjs\node_modules\rollup-plugin-typescript2\dist\rollup-plugin-typescript2.cjs.js:29500:17)
    at Object.transform (D:\git\gridjs\node_modules\rollup-plugin-typescript2\dist\rollup-plugin-typescript2.cjs.js:29785:17)
    at D:\git\gridjs\node_modules\rollup\dist\shared\rollup.js:22879:40

ERROR: "build:plugins" exited with 1.

Expected behavior

The command npm run build should work out of the box, unless there are specific steps to run before. In that case, it should be documented in the read me file.

Screenshots

image

Desktop:

mrsnax commented 7 months ago

same here, cant build properly