Error [ERR_UNSUPPORTED_DIR_IMPORT]: Directory import
See original GitHub issueVersion
@nuxtjs/firebase: 7.5.0 --> firebase: ex: 8.10.0 nuxt: 2.15.8
macOS Big Sur
Reproduction Link
Cannot share publicly but can give access in private
Steps to reproduce
npm run generate
What is Expected?
Having an “npm run generate” working
What is actually happening?
x Nuxt Fatal Error
Error [ERR_UNSUPPORTED_DIR_IMPORT]: Directory import'/Users/phil/Documents/GitHub/project/node_modules/firebase/app'
is not supported resolving ES modules imported from /Users/phil/Documents/GitHub/project/node_modules/@nuxtjs/firebase/lib/module.js
Did you mean to import
/Users/phil/Documents/GitHub/project/node_modules/firebase/app/dist/index.cjs.js?
I found this solution but i have no idea how to apply it to a Nuxt project
I tried many different versions of @nuxtjs/firebase & firebase, but issue always remain,
Can anyone help?
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Directory import when attempting to start Nodejs App ...
Error [ERR_UNSUPPORTED_DIR_IMPORT]: Directory import when attempting to start Nodejs App locally ; from 'cors' ; from 'express' ; from './models' ...
Read more >Error [ERR_UNSUPPORTED_DIR_IMPORT] in Node.js
The "Error [ERR_UNSUPPORTED_DIR_IMPORT]: Directory import is not supported" occurs in Node.js, when we try to use a directory import. To solve the error, ......
Read more >Error [ERR_UNSUPPORTED_DIR_IMPORT]: Directory ...
Error [ERR_UNSUPPORTED_DIR_IMPORT]: Directory import is not supported resolving ES modules #34439. Unanswered. perevezencev asked this question in Help.
Read more >Directory import when attempting to start Nodejs App ...
Coding example for the question Error [ERR_UNSUPPORTED_DIR_IMPORT]: Directory import when attempting to start Nodejs App locally-sequelize.js.
Read more >ES Modules in Node.js - Maxim Orlov
Importing and exporting a module in Common JS (CJS), a.k.a. the old way: ... a-folder'; // ❌ Error [ERR_UNSUPPORTED_DIR_IMPORT] // a-folder // |...
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 Free
Top 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
Thanks guys, fixed it with v8.1.0.
Unfortunately, the terminateDatabasesInGenerateHooks() function doesn’t seem to do its job anymore since v8. The warning "The command ‘nuxt generate’ finished but did not exit after 5s" this function was supposed to fix appears again. 😕
But that’s not a biggie, for Nuxt v3 I’ll have to re-write the module anyway… 😃
Thanks a lot!
@randomnessdev @lupas changing the import to
firebase/compat/app
, instead of the absolute path seems to work. You can use the patch below, if you’d like.