druxt.js
druxt.js copied to clipboard
require() of ES Module
Describe the bug After installing the druxt-site module and running the Nuxt dev server, the following error occurs:
require() of ES Module /node_modules/axios/index.js from /node_modules/vue-server-renderer/build.dev.js not supported. Instead change the require of index.js in /node_modules/vue-server-renderer/build.dev.js to a dynamic import() which is available in all CommonJS modules.
To Reproduce Steps to reproduce the behavior:
- Go to https://druxtjs.org/modules/site/getting-started
- Follow Nuxt installation instructions
- Start the Nuxt dev server
- See error
Your Environment (please complete the following information):
- OS: macOS Ventura 13.2
- Browser: Chrome
- Version: 114
Additional context
As a temporary fix, add this to your nuxt.config.js:
build: {
transpile: [
'axios'
]
}
Thanks for bringing this issue and solution to my attention. I will look further into this in an upcoming sprint.