upgrading to 4.0.0
See original GitHub issueI following the docs I can’t see why I am getting this error. Tried to follow the docs but it does not apply to my case. The docs have:
How to reflect
In general, there are only a few steps to be done:
In package.json: set "type" field value to "module" -- My packge.json does not have this.
In tsconfig.json: set "module" to ESNext or ES2020 - module is set to CommonJS if I try one of these I get -> SyntaxError: Cannot use import statement outside a module for every import in the project
In tsconfig.json: set "target" to ES2015 or newer - target is set to ES2021
-
My code
import {bootstrap} from 'fastify-decorators'
-
Logs
Error [ERR_REQUIRE_ESM]: require() of ES Module /home/user/Documents/offtopic/api/node_modules/fastify-decorators/index.js from /home/user/Documents/offtopic/api/src/lib/app.ts not supported.
Instead change the require of index.js in /home/user/Documents/offtopic/api/src/lib/app.ts to a dynamic import() which is available in all CommonJS modules.
Issue Analytics
- State:
- Created a year ago
- Comments:14 (9 by maintainers)
Top Results From Across the Web
Upgrade a Standalone to 4.0 — MongoDB Manual
To upgrade an existing MongoDB deployment to 4.0, you must be running a 3.6-series release. To upgrade from a version earlier than the...
Read more >Terraform Google Provider 4.0.0 Upgrade Guide
Before upgrading to version 4.0.0, it is recommended to upgrade to the most recent 3.X series release of the provider, make the changes...
Read more >Upgrading to version 4.0.0 of IBM Content Collector
Upgrade from an earlier Content Collector release to IBM Content Collector Version 4.0.0 by installing the V4.0.0 packages of the Content Collector ...
Read more >Updating to 4.0 | Capacitor Documentation
In this guide, you'll find steps to update your project to the current Capacitor 4 version as well as a list of breaking...
Read more >Version (4.0) → Upgrading - Vapor Docs
The first step to upgrading to Vapor 4 is to update your package's dependencies. ... + .package(url: "https://github.com/vapor/fluent.git", from: "4.0.0"), ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@unematiii,
Just released v3.12.0 with Fastify v4 support.
There’s currently 2 limitations which prevents type providers from work: