Skip to content
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

Error [RollupError]: Could not resolve "../shared/swiper-effect-utils.mjs" from "dist/modules/effect-cards.mjs" #7791

Open
5 of 6 tasks
benwallis opened this issue Nov 12, 2024 · 0 comments

Comments

@benwallis
Copy link

Check that this is really a bug

  • I confirm

Reproduction link

n/a

Bug description

Error when running using the custom build script and including "effect-cards".

Example build config:

import {
  parseSwiperBuildModulesEnv
} from './utils/helper.js';

const envBuildModules = parseSwiperBuildModulesEnv();

export const modules = envBuildModules || [
  'navigation',
  'effect-cards'
];

export default {
  modules,
};

After running npm run build:prod (using Node 20.10.0) I get the following error:

Error [RollupError]: Could not resolve "../shared/swiper-effect-utils.mjs" from "dist/modules/effect-cards.mjs"
    at error (file:///C:/www/swiper-git/node_modules/rollup/dist/es/shared/parseAst.js:337:30)
    at ModuleLoader.handleInvalidResolvedId (file:///C:/www/swiper-git/node_modules/rollup/dist/es/shared/node-entry.js:17776:24)
    at file:///C:/www/swiper-git/node_modules/rollup/dist/es/shared/node-entry.js:17738:26 {
  code: 'UNRESOLVED_IMPORT',
  exporter: '../shared/swiper-effect-utils.mjs',
  id: 'C:\\www\\swiper-git\\dist\\modules\\effect-cards.mjs',
  watchFiles: [
    'C:\\www\\swiper-git\\dist\\swiper-bundle.mjs',
    'C:\\www\\swiper-git\\dist\\shared\\swiper-core.mjs',
    'C:\\www\\swiper-git\\dist\\modules\\navigation.mjs',
    'C:\\www\\swiper-git\\dist\\modules\\effect-cards.mjs',
    'C:\\www\\swiper-git\\dist\\shared\\utils.mjs'
  ]
}

Other effects such as fade build successfully.

Expected Behavior

The build to be completed successfully.

Actual Behavior

Build fails.

Swiper version

11.1.14

Platform/Target and Browser Versions

Windows 10 Firefox/Chrome

Validations

  • Follow our Code of Conduct
  • Read the docs.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
  • Make sure this is a Swiper issue and not a framework-specific issue

Would you like to open a PR for this bug?

  • I'm willing to open a PR
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

No branches or pull requests

1 participant