Git Product home page Git Product logo

Comments (7)

martinszeltins avatar martinszeltins commented on July 18, 2024 1

Finally found the solution to my problem, had to this this:

nuxt.config.ts

export default defineNuxtConfig({
  future: {
    typescriptBundlerResolution: false
  }
})

https://nuxt.com/blog/v3-10#bundler-module-resolution

from nuxt.

manniL avatar manniL commented on July 18, 2024

Most likely dupe of #23984

from nuxt.

martinszeltins avatar martinszeltins commented on July 18, 2024

@manniL in my case I have shamefully-hoist=true and adding public-hoist-pattern[]=*nitropack* did not help. It still gives me this error even after deleting node_modules and pnpm-lock file and reinstalling dependencies.

Cannot find module 'nitropack'. Did you mean to set the 'moduleResolution' option to 'node', or to add aliases to the 'paths' option?

from nuxt.

martinszeltins avatar martinszeltins commented on July 18, 2024

I see that with Nuxt 3.10 the "moduleResolution" has been changed from "Node" to "Bundler" which seems to be causing the issue for me. What can I do about this?

from nuxt.

manniL avatar manniL commented on July 18, 2024

@martinszeltins Weird, I can't reproduce the problem with bundler resolution + PNPM on my end 🤔

from nuxt.

martinszeltins avatar martinszeltins commented on July 18, 2024

@martinszeltins Weird, I can't reproduce the problem with bundler resolution + PNPM on my end 🤔

Honestly, no idea but I'm glad the typescriptBundlerResolution setting fixed it. With Bundler resolution all these 3 lines were showing errors, when switching to Node the errors are gone.

import type { FetchResult } from 'nuxt/dist/app/composables/fetch.d.ts'
import type { KeysOf, PickFrom } from 'nuxt/dist/app/composables/asyncData'
import type { NitroFetchRequest, AvailableRouterMethod as _AvailableRouterMethod } from 'nitropack'

from nuxt.

JvanderHeide avatar JvanderHeide commented on July 18, 2024

Using regular npm and running in to the same issue as Martins.
Though for me it was for defineNuxtConfig, import {createResolver} from "@nuxt/kit"; and more.
Workaround seems to work for now.

from nuxt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.