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

Cannot build the project dependencies update #99

Closed
elturpin opened this issue Dec 13, 2023 · 3 comments
Closed

Cannot build the project dependencies update #99

elturpin opened this issue Dec 13, 2023 · 3 comments

Comments

@elturpin
Copy link
Contributor

Hi !

I wanted to add something new in the project but unfortunately, I cannot build the project anymore.

This is the error log:

src/main.ts → dist...
[!] RollupError: Expected ',', got '{' (Note that you need plugins to import files that are not JavaScript)
src/main.ts (8:12)
 6: import path from "path";
 7: import pc from "picocolors";
 8: import type { ViteDevServer } from "vite";
                ^
 9: 
10: type ViteConfig = {
RollupError: Expected ',', got '{'
    at error (/home/elturpin/Projets/vite-express/node_modules/rollup/dist/shared/parseAst.js:279:30)
    at nodeConverters (/home/elturpin/Projets/vite-express/node_modules/rollup/dist/shared/parseAst.js:2147:9)
    at convertNode (/home/elturpin/Projets/vite-express/node_modules/rollup/dist/shared/parseAst.js:1032:12)
    at convertProgram (/home/elturpin/Projets/vite-express/node_modules/rollup/dist/shared/parseAst.js:1023:48)
    at Object.parseAstAsync (/home/elturpin/Projets/vite-express/node_modules/rollup/dist/shared/parseAst.js:2213:20)
    at Module.tryParseAsync (/home/elturpin/Projets/vite-express/node_modules/rollup/dist/shared/rollup.js:14936:21)
    at Module.setSource (/home/elturpin/Projets/vite-express/node_modules/rollup/dist/shared/rollup.js:14517:35)
    at ModuleLoader.addModuleSource (/home/elturpin/Projets/vite-express/node_modules/rollup/dist/shared/rollup.js:18827:13)

Rollup does not manage to parse typescript even though the rollup plugin is there.
Using git bisect, I found that i cannot build the project since the commit "Update development dependencies" where a lot of dependencies are updated.

I tried to create a dummy project with only rollup typescript and one hello world file but the build worked perfectly with the same version of the packages.

I also tried to rollback the update only on typescript(4.9.4), tslib(2.4.1), rollup(3.7.3) and @rollup/plugin-typescript(10.0.1), and then the build was possible.

Any Idea ??

My env:

  • Node : 18.18.2
  • NPM : 10.2.5
@szymmis
Copy link
Owner

szymmis commented Dec 14, 2023

Hi @elturpin, there is indeed some problem with building the package that was not present in CI so it missed completely over my head. I need to look at it, there is something fishy with the rollup because as you said, there is a typescript plugin but it refuses to compile.

Thanks for bringing that up, I'll take a look at that as soon as I have time.

@elturpin
Copy link
Contributor Author

Hi @szymmis

I made some investigation and finally manage to reproduce the problem in a minimal repo : https://github.com/elturpin/test-rollup-ts-picocolors

The problem seems to come from the picocolors package. I have no idea why but the same compilation error occurs when picocolors is imported in a file. If the package is not imported, no problem ...

I'll try to investigate more when i'll have some free time.

@szymmis
Copy link
Owner

szymmis commented Dec 19, 2023

Should be fixed by #101.

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