-
Notifications
You must be signed in to change notification settings - Fork 909
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Module not found: Default condition should be last one #7005
Comments
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight. |
Looks like the Next.JS is emitting this error when importing the Firebase. |
also getting this. It only started about a hour ago and I even tried re building an old deploy commit. only difference it seems is firebase 9.17 just dropped |
This seems to be a result of #6981. I submitted a PR to fix this: #7006. See: #7002 (comment) |
from fixed to the version. remove |
After following @Angryman18 suggestion. It has been fixed. Thank you very much |
how do i change the firebase version angry man |
We can revert to version 9.16.0 to avoid the issue |
In package.json file |
this did not fix my issue |
Solved my issue "Module not found: Default condition should be last one " |
Its working for me bro thnx.. |
Checked all package.json files with following script /**
* Checks if all package.json has
* "default" export in `exports` entry
* to be the last one
*/
const exec = require('child_process').execSync
function main() {
const packages = exec('find node_modules -type f -name package.json').toString().split('\n')
for (const pkg of packages) {
try {
const data = require(`./${pkg}`)
if (!data.exports) {
continue
}
if (!checkIfDefaultIsLast(data.exports)) {
// console.info(pkg, data.exports, checkIfDefaultIsLast(data.exports))
console.warn('FAIL', pkg)
} else {
// console.info('OK ', pkg)
}
} catch (e) {
if (e instanceof Error) {
if (e.message.endsWith('Unexpected end of JSON input')) continue
}
console.error(e.message)
}
}
}
function checkIfDefaultIsLast(item) {
if (typeof item === 'string') return true
const entries = Array.from(Object.entries(item))
const keys = entries.map(([key]) => key)
if (keys.includes('default') && keys.indexOf('default') !== keys.length - 1) {
return false
}
for (const [, value] of Object.entries(item)) {
if (!checkIfDefaultIsLast(value)) return false
}
return true
}
main() And it seems only firebase packages have exports entry messed up Reverted to 9.16.0 |
Downgraded to 9.16.0 but now throwing new error : Compiled with problems:X ERROR in ./src/FireBase/Firebase.js 14:15-37 export 'default' (imported as 'firebase') was not found in 'firebase/app' (possible exports: FirebaseError, SDK_VERSION, _DEFAULT_ENTRY_NAME, _addComponent, _addOrOverwriteComponent, _apps, _clearComponents, _components, _getProvider, _registerComponent, _removeServiceInstance, deleteApp, getApp, getApps, initializeApp, onLog, registerVersion, setLogLevel) |
@iamSuraZz your issue probably is related to your import. import { initializeApp, getApps, getApp } from 'firebase/app'; instead of import firebase from 'firebase/app'; |
If you're having trouble to move to the
You can also create a After the removal, you will need to run another |
Fixed the error was here : |
Changing firebase version from "^9.9.0" to "9.9.0" worked for me. In some cases, removing the "^" from the firebase version in package.json, suprisingly works. |
Im having the same issue |
Version 9.16.0 strict (without ^) worked for me. |
This just started for me when upgrading |
Hi everyone, thanks for bringing this issue to our attention. I was able to reproduce the behavior. Let me check what we can do for this issue or bring someone here that can provide more context about it. I’ll update this thread if I have any information to share. |
^ means you will have minimum that version but with all upcoming patch releases & upgrades and removing ^ meaning you sticky want to install that particular version without any patch releases and updates on that version |
@jbalidiong issue caused by this commit 0bab0b7 |
Changed the version from latest to |
In combination with Quasar CLI 2.0.0 it's even worse. After upgrade Quasar CLI from 1.4.0 to 2.0.0, axios from 0.26.1 to 1.3.1 and then upgrading firebase from 9.6.6 to 9.17.0, got same error, then downgraded to 9.6.6 and it didn't even work any more. Had to undo all package upgrades and redo Quasar etc. |
I have the fix merged and am working on an emergency release ASAP, will update when it is out. |
@Angryman18 guys just follow steps from this guy. It solved the issue. |
Angryman steps work for me after switching from yarn to npm if that helps anyone else (you may need to do npm install --force) |
Version 9.17.1 has just been published to NPM, please let me know if anyone's still having problems. If you still have issues with 9.17.1, before reporting the issue here, make sure to delete your |
It works for firbase 9.16.0 because we have this issue with vercel. |
Solved with the new version (9.17.1), I had to delete package-lock and node_modules for a clean install. |
Thanks, man! It worked like a charm... |
@hsubox76, I created a new project with firebase 9.17.1. But now I'm getting some errors like this one: Error: node_modules/@angular/fire/compat/firestore/interfaces.d.ts:13:18 - error TS2430: Interface 'DocumentSnapshotExists' incorrectly extends interface 'DocumentSnapshot'. Do you have any idea? |
this solution worked for me ... it is bug only version 17? |
npm un firebase |
Deleting node_modules and then reinstalling everything with npm (with firebase version set to 9.17.1) fixed it for me. |
Describe your environment
Describe the problem
When installing the version
9.17.0
, I was getting this error on the import:Doesn't matter the order of the imports.
Rolling back to the 9.16.0 solved the problem.
Steps to reproduce:
yarn add firebase
Relevant Code:
The error is happening on the import first firebase package, doesn't matter which one of them.
The text was updated successfully, but these errors were encountered: