Skip to content

Commit 02ca90d

Browse files
justin808claude
andcommitted
Fix babel preset require path for Shakapacker 9.3.0 with explicit .js extension
The shakapacker babel preset requires the explicit .js extension in the require statement for Jest/Babel to resolve it correctly. Without the extension, Jest fails with "Cannot find module" error. Changes: - Restored .js extension in spec/dummy/babel.config.js - Added eslint-disable-next-line comment to suppress import/extensions rule Error fixed: Cannot find module '/path/to/shakapacker/package/babel/preset' at babel.config.js:1:27 This is a special case where the .js extension is required for module resolution in the Babel/Jest context, even though ESLint normally discourages it. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 1e6d1cd commit 02ca90d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

spec/dummy/babel.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
const defaultConfigFunc = require('shakapacker/package/babel/preset');
1+
// eslint-disable-next-line import/extensions
2+
const defaultConfigFunc = require('shakapacker/package/babel/preset.js');
23

34
module.exports = function createBabelConfig(api) {
45
const resultConfig = defaultConfigFunc(api);

0 commit comments

Comments
 (0)