question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

upgrading to 4.0.0

See original GitHub issue

I 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:open
  • Created a year ago
  • Comments:14 (9 by maintainers)

github_iconTop GitHub Comments

6reactions
L2jLigacommented, Jun 15, 2022

@unematiii,

Just released v3.12.0 with Fastify v4 support.

0reactions
L2jLigacommented, Jul 19, 2022

There’s currently 2 limitations which prevents type providers from work:

  1. FastifyInstance type is lost in controllers/services, hence they don’t know about selected type provider
  2. Typescript currently can’t infer any type information from decorators - https://github.com/microsoft/TypeScript/issues/48885#issuecomment-1113861727
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found