Open sir-dunxalot opened 5 years ago
I was able to work around this issue by using the browserify-middleware
and babelify
packages instead of express-babelify-middleware
:
import { Router } from 'express';
import browserify from 'browserify-middleware';
const router = Router();
const route = browserify('views/contact/view.js', {
transform: ['babelify'],
});
router.get('/contact', route);
This library does not seem to be compatible with Babel
^7.0.0
(e.g.@babel/core
). When I updated Babel from6.x
to7.x
in my app, the following error message appeared:Here is the full stack trace:
``` web_1 | 2018-11-28T19:39:21.013Z grader Error: Requires Babel "^7.0.0-0", but was loaded with "6.26.3". If you are sure you have a compatible version of @babel/core, it is likely that something in your build process is loading the wrong version. Inspect the stack trace of this error to look for the first entry that doesn't mention "@babel/core" or "babel-core" to see what is calling Babel. (While processing preset: "/usr/src/web/node_modules/@babel/preset-env/lib/index.js") while parsing file: /usr/src/web/src/views/routes/results/new/view.js web_1 | at throwVersionError (/usr/src/web/node_modules/@babel/helper-plugin-utils/lib/index.js:65:11) web_1 | at Object.assertVersion (/usr/src/web/node_modules/@babel/helper-plugin-utils/lib/index.js:13:11) web_1 | at _default (/usr/src/web/node_modules/@babel/preset-env/lib/index.js:154:7) web_1 | at /usr/src/web/node_modules/@babel/helper-plugin-utils/lib/index.js:19:12 web_1 | at /usr/src/web/node_modules/babel-core/lib/transformation/file/options/option-manager.js:317:46 web_1 | at Array.map (