fix(storage): add explicit .js extensions to ES module imports#706
Merged
fix(storage): add explicit .js extensions to ES module imports#706
Conversation
Update all relative imports in the storage module to include explicit .js file extensions, as required by Node.js ES modules. This resolves the "Directory import is not supported resolving ES modules" error. Fixes extensionless imports that cause failures in ES module environments like Vitest.
jaygiang
approved these changes
Oct 16, 2025
Collaborator
jaygiang
left a comment
There was a problem hiding this comment.
Ran npm test and it LGTM ✅
Found a couple that are missing the .js import. They aren't causing vitest failures, but not sure if it would cause issues in the future:
In on-device-storage/storage/ directory:
index.js:1-4- 4 imports without.jsIndexedDBMethod.js:1-2- 2 imports without.jsLocalStorageMethod.js:1- 1 import without.js
In main package file:
index.js:1-2- 2 imports without.js
In utilities:
on-device-storage/utilities/index.js:1- 1 import without.js
Contributor
Author
|
It's not necessary to update the example application code since it runs through vite. This update fixes an issue with modules that import the ESM version of the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Update all relative imports in the storage module to include explicit .js file extensions, as required by Node.js ES modules. This resolves the "Directory import is not supported resolving ES modules" error.
Fixes extensionless imports that cause failures in ES module environments like Vitest.