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

imagetools-core 0.1.0-next.8 uses ||= which is only available in Node 15 #51

Closed
GrygrFlzr opened this issue Mar 30, 2021 · 2 comments
Closed

Comments

@GrygrFlzr
Copy link

Currently, imagetools-core 0.1.0-next.8 uses ||= which is only available in Node 15.
This makes vite-imagetools unusable below Node 15 (can you even shim a Vite plugin with Babel?)

C:\Users\GrygrFlzr\Documents\projects\sk-64b\node_modules\.pnpm\imagetools-core@0.1.0-next.8\node_modules\imagetools-core\dist\index.cjs:30
    blur ||= config.blur === 'true';
         ^^^

SyntaxError: Unexpected token '||='
    at wrapSafe (internal/modules/cjs/loader.js:979:16)
    at Module._compile (internal/modules/cjs/loader.js:1027:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (C:\Users\GrygrFlzr\Documents\projects\sk-64b\node_modules\.pnpm\vite-imagetools@3.3.1\node_modules\vite-imagetools\dist\index.cjs:3:22)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)

Tested on:

  • Node v14.16.0
  • pnpm v5.18.9
  • Vite 2.1.4
JonasKruckenberg added a commit that referenced this issue Mar 30, 2021
Configure typescript to compile to es2018 instead of esnext.
fixes #51
@JonasKruckenberg
Copy link
Owner

JonasKruckenberg commented Mar 30, 2021

Thanks for the heads up! Typescript should now compile down to es2018, I also fixed the github workflow so unit tests get run in all nodes LTS versions 👍
Vitejs only supports nodes 12.x upwards, so vite-imagetools will too. This means compiling to es2019 should be alright 👍

@JonasKruckenberg
Copy link
Owner

JonasKruckenberg commented Mar 30, 2021

Should be addressed in release vite-imagetools@3.3.2-alpha.0(imagetools-core@0.1.0-next.9)
(Don't ask me why it's alpha instead of next, I sometimes don't get Lerna 😄)

Update:
The previous version didn't really work so there is a new version published on npm vite-imagetools@3.4.0-next.0 that fixes the previous version and also the weird naming!
I consider this issue closed, but if it persists for you feel free to reopen it!

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