bahmutov / bahmutov/cypress-angularjs-unit-test

Can't import module. Got a syntax error: SyntaxError: 'import' and 'export' may appear only with 'sourceType: module' (2:0) while parsing node_modules/cypress-angularjs-unit-test/src/index.js

Open
#44 1 comment 3 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
22
Forks
3
PR merge metrics
No merged PRs in 30d

Description

## Bug
- Cypress 3.1.0, nodejs: 8.9.2, npm: 6.2.0
- Mac OS 10.13.6
- Trying to import `mount` from `cypress-angularjs-unit-test` installed as npm dependency to my spec file. Expect to import successfully.
- actual behavior: got an error:
```SyntaxError: 'import' and 'export' may appear only with 'sourceType: module' (2:0) while parsing node_modules/cypress-angularjs-unit-test/src/index.js while parsing file: node_modules/cypress-angularjs-unit-test/src/index.js```

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the import from the Cypress spec file using the reported Cypress, Node.js, and npm versions, then inspect node_modules/cypress-angularjs-unit-test/src/index.js and the project’s module parsing configuration. Done means importing mount from cypress-angularjs-unit-test no longer raises the sourceType module syntax error.

Written by the indexing model from the issue text.

Assessment

Tech stack
angularjs, cypress, javascript, nodejs
Domain
testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.