Comments (14)
I just ran into the same issue, cloned the repo a few days ago. Using npm, jest encounters an unexpected token. Using yarn, it runs fine.
Changing babelrc.js to babel.config.js didn't help. Neither did updating the dependencies. I don't want to make my team install yarn when we are already using npm for everything else.
I am on windows 10
Node 9.5.0
npm 6.4.1
from vue-enterprise-boilerplate.
I believe the problem is now really fixed. For existing projects, downgrading babel-jest
to 23.6.x
is the key, though you'll also have to delete node_modules
and package-lock.json
and reinstall after downgrading, due to a bug in NPM's module resolution.
from vue-enterprise-boilerplate.
@bmillspaugh I wasn't able to reproduce the issue and haven't seen it reported again since, so hopefully this was a temporary regression solved in a patch update. For anyone that may want to temporarily disable unit tests in the future, you can do by adding a #
at the beginning of the values of the following scripts in package.json
: test:unit
, test:unit:file
, and test:unit:ci
. That comments them out, essentially making them a noop.
from vue-enterprise-boilerplate.
@mix3d Can you try renaming babelrc.js
to babel.config.js
and see if it works?
from vue-enterprise-boilerplate.
Nope babel.config.js
doesn't affect the jest error
from vue-enterprise-boilerplate.
I haven't been able to reproduce this, but I've just updated Vue CLI, which may fix the problem. @mix3d @ecasilla Can you confirm whether you still see this error with a fresh clone? If you still do, can you provide more information about your environment, including operating system, node version, and NPM version?
from vue-enterprise-boilerplate.
faced the same issue, updating all dependencies fixed it
from vue-enterprise-boilerplate.
@graberzz Strange - all the dependencies should have been relatively up-to-date when cloning. Would you mind sharing exactly which dependencies were causing a problem for you?
from vue-enterprise-boilerplate.
Hoping my case helps a bit with reproducing this error.
I found the instance where the unit tests are failing.
At the moment here are my specs and versions:
ProductName: Mac OS X
ProductVersion: 10.13.6
BuildVersion: 17G65
Node: v9.10.0
NPM: 6.4.1
Yarn: 1.9.4
I reproduced the getting started steps both using NPM and Yarn. Using NPM ('npm install') makes the test fail and using Yarn ('yarn') makes things go smoothly and are all working.
Steps on cloned repo with directory named 'issue_77' left screen:
- 1.- git clone https://github.com/chrisvfritz/vue-enterprise-boilerplate.git issue_77
- 2.- cd issue_77
- 3.- yarn
- 4.- node _start.js
- 5.- rm _start.js
- 6.- yarn unit || yarn test
Steps on cloned repo with directory named 'issue_77_2' right screen:
- 1.- git clone https://github.com/chrisvfritz/vue-enterprise-boilerplate.git issue_77_2
- 2.- cd issue_77
- 3.- npm install
- 4.- node _start.js
- 5.- rm _start.js
- 6.- yarn unit || yarn test
I still haven't checked deeper into why this is happening but I'll definitely try and see why the discrepancy and why only using 'npm install' makes the tests break. I'm hoping my observation helps out into helping solve this issue.
from vue-enterprise-boilerplate.
It looks like the root cause here was a bug in NPM's module resolution. I've just committed a workaround that seems to have fixed it though. If anyone is still encountering the problem, please let me know.
from vue-enterprise-boilerplate.
Hi, I've just encountered this issue with npm.
Cloned repo -> npm i -> npm run test:unit
Test suite failed to run
/{path-to-propject}/vue-enterprise-boilerplate/tests/unit/setup.js: Unexpected token (84:17)
Jest encountered an unexpected token
This usually means that you are trying to import a file which Jest cannot parse, e.g. it's not plain JavaScript.
By default, if Jest sees a Babel config, it will use that to transform your files, ignoring "node_modules".
Here's what you can do:
• To have some of your "node_modules" files transformed, you can specify a custom "transformIgnorePatterns" in your config.
• If you need a custom transformation specify a "transform" option in your config.
• If you simply want to mock your non-JS modules (e.g. binary assets) you can stub them out with the "moduleNameMapper" config option.
You'll find more details and examples of these config options in the docs:
https://jestjs.io/docs/en/configuration.html
Details:
82 | functional: true,
83 | render(h, { slots }) {
> 84 | return <div>{slots().default}</div>
| ^
85 | },
86 | },
87 | ...(options.stubs || {}),
npm 6.9.0
node v10.14.1
Can you advise please?
from vue-enterprise-boilerplate.
I am encountering the same error.
npm 6.4.1
node v10.15.3
from vue-enterprise-boilerplate.
Still appears to fail on a new clone of the repo (post fix):
git clone https://github.com/chrisvfritz/vue-enterprise-boilerplate.git unit-test-error
cd unit-test-error
yarn
yarn test:unit
With the same error:
Jest encountered an unexpected token
SyntaxError: F:\source\git\unit-test-error\tests\unit\setup.js: Unexpected token (84:17)
82 | functional: true,
83 | render(h, { slots }) {
> 84 | return <div>{slots().default}</div>
| ^
85 | },
86 | },
87 | ...(options.stubs || {}),
Is there a way to temporarily disable all tests until this is resolved (without having to delete the tests) since it prevents you from committing any changes, and also from publishing any npm packages via lerna (which requires you to commit first)?
node 11.15.0 / npm 6.7.0 / yarn 1.13.0 / jest 23.6.0
from vue-enterprise-boilerplate.
@chrisvfritz I am getting the same error with yarn and npm with versions [email protected] and [email protected]
from vue-enterprise-boilerplate.
Related Issues (20)
- Stylelint error on fresh install
- compile problem related to new source HOT 1
- Relative imports from parent directories are not allowed. HOT 2
- pre-commit doesn't do anything ! HOT 2
- Error Test in E2E
- Add template feature to repo?
- Failed Netlify deploy
- Error in test unit. something wrong with config, maybe HOT 1
- Will we update this boilerplate to vue3? HOT 3
- Where can I find examples of using this boilerplate? HOT 1
- sass-loader unable to load from updated .scss files
- Dependency Injection into Vuex Modules HOT 3
- Is this a typo or intentional? HOT 1
- TypeError: ext[key].bind is not a function HOT 3
- Getting issue while importing new component and not getting type suggestion HOT 1
- Problem setting environment variable API_BASE_URL HOT 1
- Change app.config.json at runtime
- Where do I set backend url for production?
- After "yarn upgrade" it breaks :( - Windows 10 HOT 1
- Updated dependencies release?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue-enterprise-boilerplate.