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.

Import createRouter does not exist in h3 export

See original GitHub issue

Environment

Nuxt CLI v3.0.0-27490192.4253d2e 16:02:07 RootDir: C:\Users\Lenovo\Desktop\sat 16:02:10 Nuxt project info: 16:02:10

  • Nuxt Version: 3.0.0-27490192.4253d2e
  • Package Manager: npm@8.1.4
  • Builder: vite
  • User Config: buildModules, css
  • Runtime Modules: -
  • Build Modules: @pinia/nuxt@0.1.8, nuxt-windicss@2.2.8

Package error: h3 => v0.3.9

Reproduction

I did a npm update and after it started showing the error on npm run dev. yesterday had no problems.

When I manually install “npm i h3” to the latest version it works.

Describe the bug

ERROR [worker reload] [worker init] The requested module ‘PROJECT/node_modules/h3/dist/index.mjs’ does not provide an export named ‘createRouter’

import { handleCacheHeaders, toEventHandler, createApp, createRouter, lazyEventHandler, eventHandler, useQuery } from ‘PROJECT/node_modules/h3/dist/index.mjs’; ^^^^^^^^^^^^ SyntaxError: The requested module ‘PROJECT/node_modules/h3/dist/index.mjs’ does not provide an export named ‘createRouter’ at ModuleJob._instantiate (node:internal/modules/esm/module_job:127:21) at async ModuleJob.run (node:internal/modules/esm/module_job:193:5) at async Promise.all (index 0) at async ESMLoader.import (node:internal/modules/esm/loader:337:24) at async loadESM (node:internal/process/esm_loader:88:5) at async handleMainPromise (node:internal/modules/run_main:61:12)

Additional context

No response

Logs

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

5reactions
danielroecommented, Apr 8, 2022

Thanks. We need to bump the version in unstorage (cc: @pi0).

In future I’d recommend running npx nuxi upgrade or npx nuxi upgrade --force.

2reactions
jiblett1000commented, Apr 11, 2022

Should be fixed now. At least for windicss https://github.com/windicss/nuxt-windicss/releases/tag/v2.2.9

Read more comments on GitHub >

github_iconTop Results From Across the Web

'does not provide an export named 'createRouter'' vue 3, vite ...
There is an easy solution if exported module actually exports only methods, but you still want to import all of them as an...
Read more >
Im using VueJs and Laravel8 and i want to import vue-router ...
js :"export 'VueRouter' was not found in 'vue-router'. Im using VueJs and Laravel8 and i want to import vue-router. Her is my app.js...
Read more >
Header and Toolbar of main component is not displaying
I have imported the MainLayout in HomePage.vue component but it stills show that same warning. I have also noticed the below warning on...
Read more >
Complex Vue 3 state management made easy with Pinia
Here, we import and extract all necessary data from post store. We can't use destructuring for state properties and getters because they will...
Read more >
Understand Routing in Vue.js With Examples | by SaidHayani
import home from '@/components/home'Vue.use(Router)export default new Router({ ... The vue-router has more advanced parameters and methods, but we are not ...
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