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

Error reported during compilation #400

Open
dengxueru opened this issue Jan 30, 2024 · 7 comments
Open

Error reported during compilation #400

dengxueru opened this issue Jan 30, 2024 · 7 comments

Comments

@dengxueru
Copy link

dengxueru commented Jan 30, 2024

version 1.1.1
image

@netroy
Copy link
Member

netroy commented Jan 30, 2024

1.1.1 is still a node.js-only release, and no bundlers are supported.
But, 2.0 plans to address this.

can you please install image-size@beta, and try again?

@dengxueru
Copy link
Author

1.1.1 is still a node.js-only release, and no bundlers are supported. But, 2.0 plans to address this.

can you please install image-size@beta, and try again?

  1. I used image-size@beta, which did not solve this problem.
  2. It should be a compilation problem
    error in ./node_modules/image-size/dist/esm/lookup.mjs
    I saw that the error message was size.type = size.type ?? type. Is this new syntax not supported??
  3. I cannot use babel to adapt to the advanced syntax in node_modules

@netroy
Copy link
Member

netroy commented Jan 30, 2024

Ah, The error with ?? sounds like that your setup doesn't support Nullish coalescing operator, which has been supported on most tooling for a few years now.

Would it be possible to create a test setup reproducing this issue? Then I could provide recommendations around how to fix this.

@netroy
Copy link
Member

netroy commented Jan 31, 2024

@dengxueru is there any more information you can share about your build tooling? without that it's difficult to support you.

Since, we can't expect npm package maintainers to not new (but stable) language features, the solution here would be to try to fix the tooling instead.

If that's not an option, I'd recommend downgrading to 1.0.2 instead.
If a someday a security issue is discovered in 1.0.2, I'll try my best to release 1.0.3.

@GoodAppsNY
Copy link

@dengxueru is there any more information you can share about your build tooling? without that it's difficult to support you.

Since, we can't expect npm package maintainers to not new (but stable) language features, the solution here would be to try to fix the tooling instead.

If that's not an option, I'd recommend downgrading to 1.0.2 instead. If a someday a security issue is discovered in 1.0.2, I'll try my best to release 1.0.3.

I experience the same error, v1.1.1 with the "??" worked fine while compiling with Node v18.17.0 on windows, but did not when deploying my Node.js Express Web App to Linux on Azure built with Node - 10.10

Downgrading to 1.0.2 has resolved the compile error for my app.

@netroy
Copy link
Member

netroy commented Feb 9, 2024

I don't really want to provide support for decommissioned versions of nodejs. Nodejs 10.10 is almost 6 years old.

But just in case this is somehow business critical, please let me know. Fixing this is not a big deal.

However I prefer to keep this issue open as a reminder that all actively maintained systems should update their entire stack, not just their node_modules. Older versions of nodejs (or any runtime) are likely to be a security nightmare.

@GoodAppsNY
Copy link

@netroy You are absolutely right... being new to Azure, my initial assumption when deploying my app was that azure would select the latest stable version of Node when creating an initial web app project.. I am seeing that after updating Node to 20-LTS I am able to use v1.1.1 of image-size.

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

3 participants