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

SyntaxError: 'import' and 'export' may appear only with 'sourceType: module' #1233

Closed
3 tasks done
dnovikau opened this issue Sep 17, 2024 · 1 comment
Closed
3 tasks done

Comments

@dnovikau
Copy link

dnovikau commented Sep 17, 2024

Current behavior

After upgrading "aws-amplify" package version from "4.3.7" to "6.6.0" tests started failing with the exception:
SyntaxError: 'import' and 'export' may appear only with 'sourceType: module'

Screenshot 2024-09-17 at 16 09 17

Test code to reproduce

https://github.com/dnovikau/browserify-preprocessor/tree/main

Note: provided code works fine with "aws-amplify": "4.3.7" but not with latest version

Versions

  • Cypress version: "13.14.2"
  • Preprocessor version: "20.1.2"
  • Node version: "20.11.1"
Screenshot 2024-09-17 at 16 15 22

SyntaxError: 'import' and 'export' may appear only with 'sourceType: module'

Checklist

  • I've read the FAQ.
  • I've read instructions for logging issues.
  • I'm not using cypress-cucumber-preprocessor@4.3.1 (package name has changed and it is no longer the most recent version, see #689).
@badeball
Copy link
Owner

badeball commented Sep 18, 2024

Not an issue with the preprocessor.

This is related browserify, its default options and the type of libraries you're importing. I can't help you with tweaking this. You can specify options as a 2nd argument to preprocessor(..), but I recommend just using a different bundler altogether.

Furthermore, is it even supposed to run in the browser environment? If not, then cypress/support/index.js isn't the right place to import it.

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

2 participants