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

rollup version is too old (is fake) #923

Open
Aloento opened this issue Apr 12, 2022 · 23 comments
Open

rollup version is too old (is fake) #923

Aloento opened this issue Apr 12, 2022 · 23 comments
Labels
bug Something isn't working

Comments

@Aloento
Copy link

Aloento commented Apr 12, 2022

"@wmrjs/service-worker@^0.3.1":
  version "0.3.1"
  dependencies:
    rollup "^2.0.0"
rollup@^2.0.0:
  version "2.70.1"

then "@rollup/plugin-commonjs" requires at least [email protected] but found [email protected].
Cannot fix this by yarn add -D rollup

I recommend you to use the dependence bot or npm-check-updates to keep new for your deps.

@Aloento Aloento added the bug Something isn't working label Apr 12, 2022
@rschristian
Copy link
Member

rschristian commented Apr 12, 2022

We're using Rollup 2.52.7:

"rollup": "^2.52.7",

Our deps are all inlined, so if you have rollup in your lock file then it hasn't come from installing WMR.

@Aloento
Copy link
Author

Aloento commented Apr 12, 2022

I know wmr is new but my old rollup is from your package @wmrjs/service-worker
It's also your package, or maybe you don't maintain this package, then I will remove it.

@rschristian
Copy link
Member

rschristian commented Apr 12, 2022

Your lock file clearly shows it resolving to 2.70, so I don't know what is referring to 2.8, but it's not us I don't think.

@Aloento
Copy link
Author

Aloento commented Apr 12, 2022

Yes, I am also confused about this.
I try to look for the node_modules and see what exactly the version is.
And it's the newest version of rollup but, the plug-in always says it's the old version.
I use a new project and I will show you the debug things.

@Aloento
Copy link
Author

Aloento commented Apr 12, 2022

SoarT@Soar-Blade ~\Downloads\WMR ❯❯❯ yarn run start
Debugger attached.
yarn run v1.22.18
$ wmr
Debugger attached.

Error: Insufficient Rollup version: "@rollup/plugin-commonjs" requires at least [email protected] but found [email protected].
    at validateRollupVersion (C:\Users\SoarT\Downloads\WMR\node_modules\@rollup\plugin-commonjs\dist\index.js:682:11)
    at Object.buildStart (C:\Users\SoarT\Downloads\WMR\node_modules\@rollup\plugin-commonjs\dist\index.js:1791:7)
    at C:\Users\SoarT\Downloads\WMR\node_modules\wmr\wmr.cjs:2:2973713
    at Array.map (<anonymous>)
    at Object.buildStart (C:\Users\SoarT\Downloads\WMR\node_modules\wmr\wmr.cjs:2:2973677)
    at Dwt (C:\Users\SoarT\Downloads\WMR\node_modules\wmr\wmr.cjs:2:3009029)
    at eDt (C:\Users\SoarT\Downloads\WMR\node_modules\wmr\wmr.cjs:2:3021787)
    at async Zwt (C:\Users\SoarT\Downloads\WMR\node_modules\wmr\wmr.cjs:2:3021244)

Waiting for the debugger to disconnect...
error Command failed with exit code 1.

image
image

@rschristian
Copy link
Member

Why are you installing @rollup/plugin-commonjs out of curiosity? I could not reproduce the error locally when adding @wmrjs/service-worker to an app.

@Aloento
Copy link
Author

Aloento commented Apr 12, 2022

reproduce this error just with
yarn add @rollup/plugin-commonjs

wmr.config.mjs
import commonjs from "@rollup/plugin-commonjs";
plugins: [commonjs()],

then you cannot start wmr.

I'm trying to solve this problem so I add @rollup/plugin-commonjs
Currently, I can't use WMR to working my project at all.

@rschristian
Copy link
Member

Hm, still cannot reproduce that error. Can you clear node_modules and your lock file and try installing again? What version of Yarn are you using? I'm on 1.22.18 which seems to be working.

All I've done is create a new project, add that plugin, and add it to the config. Is that a correct reproduction?

@Aloento
Copy link
Author

Aloento commented Apr 12, 2022

Let me clean everything and restart my computer, then see what will happen.


Ok, still wrong...

Let me use Linux to try again.


Not working.... outrageous

@rschristian
Copy link
Member

Can you try cloning and running this?

https://github.com/rschristian/wmr-rollup-cjs

Try installing with yarn --frozen-lockfile

@Aloento
Copy link
Author

Aloento commented Apr 12, 2022

this is my env, I will try yours.
https://github.com/Aloento/WMR


Still wrong...
I suspect there may be something wrong with my environment.
Let me open a virtual machine and try it.

@rschristian
Copy link
Member

I'm on Linux,, using Yarn v1 (1.22.18), if it helps. Bizarre issue.

@Aloento
Copy link
Author

Aloento commented Apr 12, 2022

Still wrong in clean Win 11 virtual machine (Sandbox).
With nodejs 17.9.0 and yarn v1.22.18
I now try with Linux virtual machine.


Still wrong... omg...

@rschristian
Copy link
Member

I'm on Node 14.19.1, though I don't think anything's really changed there.

@Aloento
Copy link
Author

Aloento commented Apr 12, 2022

I tried with your node version and it's started but still thrown... funny...

(node:6804) UnhandledPromiseRejectionWarning: Error: Insufficient Rollup version: "@rollup/plugin-commonjs" requires at least [email protected] but found [email protected].
    at validateRollupVersion (C:\Users\WDAGUtilityAccount\Desktop\wmr-rollup-cjs-master\node_modules\@rollup\plugin-commonjs\dist\index.js:682:11)
    at Object.buildStart (C:\Users\WDAGUtilityAccount\Desktop\wmr-rollup-cjs-master\node_modules\@rollup\plugin-commonjs\dist\index.js:1791:7)
    at C:\Users\WDAGUtilityAccount\Desktop\wmr-rollup-cjs-master\node_modules\wmr\wmr.cjs:2:2973713
    at Array.map (<anonymous>)
    at Object.buildStart (C:\Users\WDAGUtilityAccount\Desktop\wmr-rollup-cjs-master\node_modules\wmr\wmr.cjs:2:2973677)
    at Dwt (C:\Users\WDAGUtilityAccount\Desktop\wmr-rollup-cjs-master\node_modules\wmr\wmr.cjs:2:3009029)
    at eDt (C:\Users\WDAGUtilityAccount\Desktop\wmr-rollup-cjs-master\node_modules\wmr\wmr.cjs:2:3021787)
    at async Zwt (C:\Users\WDAGUtilityAccount\Desktop\wmr-rollup-cjs-master\node_modules\wmr\wmr.cjs:2:3021244)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:6804) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:6804) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

  👩‍🚀 WMR dev server running at:

  Local:   http://localhost:8080
  Network: (disabled, see --host)

And the page cannot be showing.

I'm giving up.

@Aloento Aloento closed this as completed Apr 12, 2022
@rschristian rschristian reopened this Apr 12, 2022
@rschristian
Copy link
Member

Shoot, I'm really sorry, I didn't notice you were running the dev server.

I can reproduce there. Can you confirm that wmr build doesn't result in that error?

@Aloento
Copy link
Author

Aloento commented Apr 12, 2022

SoarT@Soar-Blade ~\Downloads\WMR git:master ❯❯❯ yarn run build
Debugger attached.
yarn run v1.22.18
$ wmr build --prerender
Debugger attached.

SyntaxError: Unexpected token: punc (:)
  1 | …
> 2 | …pos=i}}function nd(e,t,n,r,i){throw new td(e,t,n,r,i)}function rd(e,t,n){…
    |                                      ^

    at nd (C:\Users\SoarT\Downloads\WMR\node_modules\wmr\wmr.cjs:2:399363)
    at B (C:\Users\SoarT\Downloads\WMR\node_modules\wmr\wmr.cjs:2:408097)
    at c (C:\Users\SoarT\Downloads\WMR\node_modules\wmr\wmr.cjs:2:408188)
    at l (C:\Users\SoarT\Downloads\WMR\node_modules\wmr\wmr.cjs:2:408241)
    at m (C:\Users\SoarT\Downloads\WMR\node_modules\wmr\wmr.cjs:2:408780)
    at _ (C:\Users\SoarT\Downloads\WMR\node_modules\wmr\wmr.cjs:2:412876)
    at e (C:\Users\SoarT\Downloads\WMR\node_modules\wmr\wmr.cjs:2:409997)
    at C:\Users\SoarT\Downloads\WMR\node_modules\wmr\wmr.cjs:2:408887
    at E (C:\Users\SoarT\Downloads\WMR\node_modules\wmr\wmr.cjs:2:412606)
    at e (C:\Users\SoarT\Downloads\WMR\node_modules\wmr\wmr.cjs:2:409993)

Waiting for the debugger to disconnect...
error Command failed with exit code 1.

@rschristian
Copy link
Member

Well... different error is progress?

@developit
Copy link
Member

The official Rollup commonjs plugin won't work with WMR's dev server, because it's not a full Rollup implementation. The version number is fake, but even if that were updated this wouldn't work - it's missing things like the plugin metadata API. Also, the way the CommonJS plugin works is extremely complex and retains data across multiple plugin passes, which does not work with the model WMR uses where each file is an individual HTTP request.

That error looks like TypeScript is being authored in a non-TypeScript file (.js or .mjs).

@Aloento
Copy link
Author

Aloento commented Apr 12, 2022

uh... I didn't write any type...
#922 should reopen...
So do you have any solution for the commonjs?

@rschristian
Copy link
Member

rschristian commented Apr 12, 2022

@developit Interestingly the package that's throwing the error (react-helmet-async) is one built with Microbundle.... Granted might be in one of the deps, the error position doesn't exactly make it clear.

@Aloento Aloento changed the title rollup version is too old rollup version is too old (is fake) Apr 12, 2022
@developit
Copy link
Member

@rschristian I thought it was because of the scheduler package?

@rschristian
Copy link
Member

They've had two separate issues with two separate packages:

  • @fluentui/react-components leads to scheduler
  • react-helmet-async leads to the above Unexpected punc (:). As for where that token is, no clue, as we don't seem to create a stack trace that actually identifies where it's from.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants