Vue template using this.$nextTick results in "[nuxt] [request error] require is not defined in ES module scope..."
See original GitHub issueEnvironment
- Operating System:
Darwin
- Node Version:
v17.8.0
- Nuxt Version:
3.0.0-rc.1
- Package Manager:
yarn@1.22.18
- Builder:
vite
- User Config:
vue
,head
,plugins
,components
,buildModules
,modules
,axios
,auth
,build
,styleResources
,css
,vite
,bootstrapVue
,loading
,loadingIndicator
,router
,privateRuntimeConfig
,publicRuntimeConfig
,pwa
,hooks
- Runtime Modules:
nuxt-session@1.0.3
,cookie-universal-nuxt@2.1.5
,bootstrap-vue/nuxt
,nuxt-helmet@2.1.1
- Build Modules:
@nuxtjs/eslint-module@3.1.0
,@nuxt-hero-icons/outline/nuxt@1.0.1
Reproduction
yarn run dev
on a project I am attempting to migrate from Nuxt 2
Describe the bug
Error:
[nuxt] [request error] require is not defined in ES module scope, you can use import instead
at $id_1ccadb5e (./.nuxt/dist/server/server.mjs:14959:22)
Offending line in server.mjs:
const { nextTick } = require('vue');
The Vue template in question uses this.$nextTick
and if I remove the calls to that, the error goes away.
Additional context
No response
Logs
No response
Issue Analytics
- State:
- Created a year ago
- Comments:13 (5 by maintainers)
Top Results From Across the Web
[nuxt] [request error] require is not defined in es module scope ...
The Vue template in question uses this.$nextTick and if I remove the calls to that, the error goes away. Additional context. No response....
Read more >require is not defined in ES module scope, you can use import ...
The error output is : Requiring external module babel-register ReferenceError: require is not defined in ES module ...
Read more >Available rules - eslint-plugin-vue
Rule ID Description
vue/multi‑word‑component‑names require component names to be always multi‑word...
vue/no‑arrow‑functions‑in‑watch disallow using arrow functions to define watcher...
vue/no‑computed‑properties‑in‑data disallow accessing computed properties in data...
Read more >vue-template-compiler | Yarn - Package Manager
For pull requests please see src/platforms/web/entry-compiler.js. This package can be used to pre-compile Vue 2.0 templates into render functions to avoid ...
Read more >The loading Property - Nuxt
Nuxt uses its own component to show a progress bar between the routes. You can customize it, disable it or create your own...
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 FreeTop 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
Top GitHub Comments
Fix landed in
unimport@0.2.7
, you may need to update your lockfile to have the latestunimport
installedYou can run
yarn upgrade unimport
ornpm upgrade unimport
.