babeljs

How to make a vuejs application work with IE 11 when using feathersjs

南楼画角 提交于 2020-01-14 03:01:10
问题 When creating a standard vue app (using vue-cli v3.0) and including @feathersjs/feathers in order to implement a connection with a feathers API, I get an error with Internet Explorer 11 ( SCRIPT1010: Expected identifier ) The bottom line is to find an easy way to solve issues like this, because on bigger projects one could easily find lots of library issues and sometimes is necessary to support at least one version of Internet Explorer (at least from the business point of view) I read on

webpack 4 react unexpected token …(spread operator)

南笙酒味 提交于 2020-01-13 19:20:16
问题 Recently i have implemented Webpack 4 setup for my react app. My webpack.config.js looks like this const HtmlWebPackPlugin = require('html-webpack-plugin'); const htmlWebpackPlugin = new HtmlWebPackPlugin({ template: './src/index.js', filename: './index.html', }); module.exports = { module: { rules: [ { test: /\.js$/, exclude: /node_modules/, use: { loader: 'babel-loader', }, }, { test: /\.css$/, use: [ { loader: 'style-loader', }, { loader: 'css-loader', options: { modules: true,

How to solve permission denied error with react native?

北慕城南 提交于 2020-01-13 11:23:31
问题 UPDATE: In terminal I see this file has "-rw-r--r--". What command do I need to run in order to change this to the right permission? I'm trying to run react-native run-ios and I keep getting the error shown below: return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode); ^ Error: EACCES: permission denied, open '/Users/sharatakasapu/Desktop/projects/albums/node_modules/.cache/@babel/register/.babel.7.2.2.development.json' at Object.fs.openSync (fs.js:646:18) at Object.fs

babel-jest ES2015 import statements

允我心安 提交于 2020-01-13 10:14:08
问题 has anyone been writing jasmine / jest tests using es2015 syntax? how much shimming / polyfill / gerrymandering does it require? i’m having trouble importing functions correctly. i have one module: …./utils/TweetUtils.js 'use strict'; export function getListOfTweetIds (tweets) { return Object.keys(tweets); }; and one test suite: …./__tests__/TweetUtils-test.js 'use strict'; jest.dontMock('../TweetUtils'); import * as TweetUtils from '../TweetUtils'; describe('Tweet utilities module', () => {

babel-jest ES2015 import statements

不羁的心 提交于 2020-01-13 10:13:57
问题 has anyone been writing jasmine / jest tests using es2015 syntax? how much shimming / polyfill / gerrymandering does it require? i’m having trouble importing functions correctly. i have one module: …./utils/TweetUtils.js 'use strict'; export function getListOfTweetIds (tweets) { return Object.keys(tweets); }; and one test suite: …./__tests__/TweetUtils-test.js 'use strict'; jest.dontMock('../TweetUtils'); import * as TweetUtils from '../TweetUtils'; describe('Tweet utilities module', () => {

babel-jest ES2015 import statements

╄→гoц情女王★ 提交于 2020-01-13 10:13:53
问题 has anyone been writing jasmine / jest tests using es2015 syntax? how much shimming / polyfill / gerrymandering does it require? i’m having trouble importing functions correctly. i have one module: …./utils/TweetUtils.js 'use strict'; export function getListOfTweetIds (tweets) { return Object.keys(tweets); }; and one test suite: …./__tests__/TweetUtils-test.js 'use strict'; jest.dontMock('../TweetUtils'); import * as TweetUtils from '../TweetUtils'; describe('Tweet utilities module', () => {

spread operator issues with property accessors (getters)

我只是一个虾纸丫 提交于 2020-01-13 09:19:06
问题 I'm having a hard time understanding why there are some issues with the following code https://jsfiddle.net/q4w6e3n3/3/ Note: All examples are tested in chrome version 52.0.2743.116 just in case this helps const model = { someVal: 'some val', }; const obs = { ...model, get accessor() { return this.someVal; }, } // Expected: '>>> some val' // Actual: '>>> undefined' console.log('>>>', obs.accessor); But the following similar snippet works https://jsfiddle.net/q4w6e3n3/5/ const model = {

Webpack, React, JSX, Babel - Unexpected token <

前提是你 提交于 2020-01-13 05:08:28
问题 This is what I have, using ExpressJS: |-- app | |-- index.js |-- node_modules | |-- babel-core | |-- babel-loader | |-- babel-preset-react | |-- express | |-- react | |-- react-dom | |-- webpack |-- public | |-- js | | |-- app.js | |-- index.html |-- .babelrc |-- index.js |-- package.json |-- webpack.config.js /webpack.config.js module.exports = { entry: [ './app/index.js' ], module: { loaders: [{ test: /\.js$/, include: __dirname + '/app', loader: "babel-loader", query: { presets:['react'] }

Babel replaces this with undefined

拈花ヽ惹草 提交于 2020-01-12 11:45:01
问题 This code beforeEach(() => { this.asd= '123'; this.sdf= '234'; this.dfg= '345'; this.fgh= '456'; }); has been transpiled by Babel to: beforeEach(function() { undefined.asd= '123'; undefined.sdf= '234'; undefined.dfg= '345'; undefined.fgh= '456'; }); Why? 回答1: Presumably that code is at the top-level scope of a module, and so it's in strict mode (the default for modules is strict mode), or a file that is being evaluated in strict mode (because it has "use strict" or because of Babel's defaults

Babel replaces this with undefined

非 Y 不嫁゛ 提交于 2020-01-12 11:44:31
问题 This code beforeEach(() => { this.asd= '123'; this.sdf= '234'; this.dfg= '345'; this.fgh= '456'; }); has been transpiled by Babel to: beforeEach(function() { undefined.asd= '123'; undefined.sdf= '234'; undefined.dfg= '345'; undefined.fgh= '456'; }); Why? 回答1: Presumably that code is at the top-level scope of a module, and so it's in strict mode (the default for modules is strict mode), or a file that is being evaluated in strict mode (because it has "use strict" or because of Babel's defaults