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
Must use import to load ES Module: path/to/project-root/node_modules/dexie/dist/modern/dexie.mjs #1369
Comments
I've resolved this by using the next-transpile-modules plugin // eslint-disable-next-line
const withDexie = require('next-transpile-modules')(['dexie']);
module.exports = withDexie({
// your other config here...
}) |
Thank you @neilnahid . This also turned out to be the fix for a different-but-evidently-related error that I was seeing:
|
Hrm. This same issue appears for this import statement when attempting to upgrade to Dexie@3.2.0. Based on the example in the README here, that should work, I think. I'm a bit reluctant to add @neilnahid @dfahlander don't suppose you can add any more clues / input? I've tried a few tweaks to the import code mentioned, and can experiment a bit more to help track this down. |
The issue is reported in #1439. Dexie 3.2.0 cannot be required but could be so in previous versions. A new version 3.2.1-beta.2 is just recently published with an extended "exports" field in package.json that hopefully resolves this. |
Thanks @dfahlander - and confirmed that 3.2.1-beta.2 solves the issue (I'll echo that in #1439 as well). |
Adding
|
I'm currently using nextjs 11 + typescript and I followed this example: https://github.com/dfahlander/dexie-todo-list
and then I encountered this error
I'm trying to run dexie in the browser.
The text was updated successfully, but these errors were encountered: