-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot find module './stringify' #416
Comments
I investigated that this only happen when u install the package with pnpm |
I have the same issue. Using pnpm too. Any solution? |
I haven't looked at the "why", but adding |
Same issue, using pnpm too |
PNPM structures it's dependencies differently and doesn't allow dependencies to access each other (shamefully-hosting). This is an issue with how the 'qs' dependency is accessed. Simple fixes are adding the qs dependency yourself or enabling shamefully-hosting, but end goal should be that this is fixed in the package itself. |
IssueBefore a week ago, I've lunched a blog feature on a live website with this module and Strapi v5. Wanted to test even more some of the new Strapi features, so yesterday I've made new installation and module is not working anymore. Must say that it was a big surprise as everything was working just fine a week ago. I've tried to downgrade Nuxt, Vite, install qs, etc. but nothing seems to work. So again I made a fresh installation just to be sure, again with npm: "dependencies": { export default defineNuxtConfig({ Result:
Any thoughts on what to do or what to expect from this module are highly appreciated. Thanks |
This may have something to do with how a specific dependency(qs) is imported and use. Had a similar issue with a package of mine and the pnpm users. I think if we updated how the import is done along with adding |
@BayBreezy ...thank you very much. |
Solution found for my problem: nuxt/nuxt#30749 (comment) Previous comment
I'm experiencing the same problem using yarn and workspaces.
The error: [nuxt] [request error] [unhandled] [500] Cannot find module './stringify'
Require stack:
- /home/luke/projects/kmuip/conmgmt/packages/app/qs I tried several approaches, from using nohoist in the package.json workspace definition to pinning a specific version using resolutions. I tried it with The moment I remove Edit: Removing the import of stringify also resolves the problem:
Edit 2, workaround: Changing the imports of stringify, parse and formats from require to "import from" seems to resolve the issue for me. I had to change the index.js file (node_modules/qs/lib/index.js) in the workspace node_modules folder. 'use strict';
var stringify = require('./stringify');
var parse = require('./parse');
var formats = require('./formats');
module.exports = {
formats: formats,
parse: parse,
stringify: stringify
}; to 'use strict';
import stringify from './stringify.js';
import parse from './parse.js';
import formats from './formats.js';
module.exports = {
formats: formats,
parse: parse,
stringify: stringify
}; I don't know why exactly |
Thanks luke-z |
Version
"@nuxtjs/strapi": "^1.12.0",
"nuxt": "^3.11.2",
"vue": "^3.4.27",
"vue-router": "^4.3.2"
Steps to reproduce
I have a clean Nuxt installation. Add the package how it's recommended and after the dev server breaks with the following error:
The text was updated successfully, but these errors were encountered: