Skip to content

fix(storage): add explicit .js extensions to ES module imports#706

Merged
thgaskell merged 1 commit intomainfrom
fix/radfish-esm-imports
Oct 17, 2025
Merged

fix(storage): add explicit .js extensions to ES module imports#706
thgaskell merged 1 commit intomainfrom
fix/radfish-esm-imports

Conversation

@thgaskell
Copy link
Contributor

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.

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.
Copy link
Collaborator

@jaygiang jaygiang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 .js
  • IndexedDBMethod.js:1-2 - 2 imports without .js
  • LocalStorageMethod.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

@thgaskell
Copy link
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 radfish package.

@thgaskell thgaskell merged commit da827af into main Oct 17, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants