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

SyntaxError when run with Node 22+ because of the removed assert syntax #10

Open
peterwooley opened this issue Jul 10, 2024 · 0 comments

Comments

@peterwooley
Copy link

Hey! Thanks for this tool. It's nice to know I won't lose these TikTok videos like I did with Vine.

I ran into an issue using the latest version of Node (22.4.1). It looks like they removed the assert usage for importing packages starting in Node 22.0. I believe assert can just be replaced with with.

/path/to/npm/node_modules/tikfav/index.js:12
import packageInfo from './package.json' assert { type: 'json' };
                                         ^^^^^^

SyntaxError: Unexpected identifier 'assert'
    at compileSourceTextModule (node:internal/modules/esm/utils:337:16)
    at ModuleLoader.moduleStrategy (node:internal/modules/esm/translators:164:18)
    at callTranslator (node:internal/modules/esm/loader:439:14)
    at ModuleLoader.moduleProvider (node:internal/modules/esm/loader:445:30)
    at async ModuleJob._link (node:internal/modules/esm/module_job:106:19)

Node.js v22.4.1

When I ran the script on Node 20.15.1, it worked like a charm, so hopefully this just requires a keyword change.

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

1 participant