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

Quire new command fails with newer version of Node #968

Open
1 task done
tinykite opened this issue Nov 8, 2024 · 2 comments
Open
1 task done

Quire new command fails with newer version of Node #968

tinykite opened this issue Nov 8, 2024 · 2 comments
Assignees
Labels
status:backlog Issue is a lower priority but needs to eventually be addressed status:triage needed Issue needs to be triaged by the Quire team. This label is automatically applied to new issues.

Comments

@tinykite
Copy link

tinykite commented Nov 8, 2024

Before proceeding, make sure there isn’t an existing issue for this bug.

  • I have searched the existing issues and determined this is a new bug.

Expected Behavior

I expected to be able to use the most recent node version with long-term-support with the quire CLI.

Actual Behavior

The command quire new test-project fail to run, and outputs the following command line error:

file:///Users/tinykite/.nvm/versions/node/v22.11.0/lib/node_modules/@thegetty/quire-cli/bin/cli.js:4
import packageConfig from '#root/package.json' assert { type: 'json' }
                                               ^^^^^^

SyntaxError: Unexpected identifier 'assert'
    at compileSourceTextModule (node:internal/modules/esm/utils:340:16)
    at ModuleLoader.moduleStrategy (node:internal/modules/esm/translators:102:18)
    at #translate (node:internal/modules/esm/loader:433:12)
    at ModuleLoader.loadAndTranslate (node:internal/modules/esm/loader:480:27)
    at async ModuleJob._link (node:internal/modules/esm/module_job:112:19)
    
Node.js v22.11.0

Steps to Reproduce

Using nvm to manage node versions:

nvm install 22.11.0  
nvm use 22.11.0  
npm install -g @thegetty/quire-cli
quire new test-project     

Version Numbers

quire info --debug fails to run and outputs the same error:

file:///Users/tinykite/.nvm/versions/node/v22.11.0/lib/node_modules/@thegetty/quire-cli/bin/cli.js:4
import packageConfig from '#root/package.json' assert { type: 'json' }
                                               ^^^^^^

SyntaxError: Unexpected identifier 'assert'
    at compileSourceTextModule (node:internal/modules/esm/utils:340:16)
    at ModuleLoader.moduleStrategy (node:internal/modules/esm/translators:102:18)
    at #translate (node:internal/modules/esm/loader:433:12)
    at ModuleLoader.loadAndTranslate (node:internal/modules/esm/loader:480:27)
    at async ModuleJob._link (node:internal/modules/esm/module_job:112:19)

Node.js v22.11.0

Web Browser

No response

Relevant Terminal/Shell Output

(Shown above)

Supporting Information

I wasn't familiar with what this error meant, so I went looking for specific updates to Node that would break the cli. As far as I understand, this seems to have happened in esm: drop support for import assertions. A PR had previously been merged to update documentation to reflect that developers should use import attributes rather than import assertions. This more recent update removes support for import assertions entirely.

From the pull request description:

This patch removes support for the assert keyword for import attributes. It was an old variant of the proposal that was only shipped in V8 and no other
engine, and that has then been replaced by the with keyword.

Chrome is planning to remove support for assert
in version 126, which will be released in June.

Node.js already supports the with keyword for
import attributes, and this patch does not change that.

The import attributes v8 documentation explains why import assertions have been deprecated, and how to fix it.

As far as I can tell, v8 now intends the assert keyword here:

import packageConfig from '#root/package.json' assert { type: 'json' }

To be replaced with with instead:

import packageConfig from '#root/package.json' with { type: 'json' };
@tinykite tinykite added the status:triage needed Issue needs to be triaged by the Quire team. This label is automatically applied to new issues. label Nov 8, 2024
@tinykite tinykite changed the title Quire new command fails with newer versions of Node Quire new command fails with newer version of Node Nov 8, 2024
@Erin-Cecele Erin-Cecele added the status:backlog Issue is a lower priority but needs to eventually be addressed label Nov 12, 2024
@Erin-Cecele
Copy link
Collaborator

Hi @tinykite. Thank you for opening this issue! For now, the Quire CLI is compatible with Node 18 and Node 20, but we are working with our developers to update to 11ty 3 and make it so the Quire CLI is compatible with the LTS version of Node as well. Stay tuned!

@tinykite
Copy link
Author

@Erin-Cecele Ah, thank you so much for sharing that and clarifying the team's priorities! That's very much appreciated.

I had totally missed the section of the Quire documentation that mentions the CLI has a specific Node version requirement.

Node.js enables you to run javascript on your computer. Download and install the Quire-supported version of Node.js. Use the drop-down menu to select v18.20.4 (LTS):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:backlog Issue is a lower priority but needs to eventually be addressed status:triage needed Issue needs to be triaged by the Quire team. This label is automatically applied to new issues.
Projects
None yet
Development

No branches or pull requests

2 participants