我的index.js文件有很多代码,可以分成很多部分。
基本上看起来是这样的:
importing many dependencies;
importing many custom functions;
defining constants;
setting up express;
setting up apollo-server;
post-request #1
get-request #1
requests....
app.listern on port
我希望我的index.js文件只包含导入
要做到这一点,我已经将我的代码分成了许多.js文件。大多数文件没有导出任何内容,但表示
我使用离子4与角制作一个离子指纹应用程序。我正在使用来自的示例代码。跟随着所有的步骤。当我命令构造函数并跟随代码运行时,当我将设置整个代码时,我将得到一个白色屏幕,其中有以下错误:
consolelogs.js:49错误:未知(承诺):TypeError: Object(.)不是函数TypeError: Object(.)不是Module../node_modules/@ionic-native/fingerprint-aio/index.js at index.js:92 (index.js:141) at webpack_require (引导代码:84)在模块../src/app/hom
我的代码中没有名为reducer的类或函数reducer,但解释说在index.js中默认使用index.js,有名为reducer的类或函数,我没有错误,如何编译? 我已经使用create-react -app创建了应用程序 以下是作为reducers的index.js代码 import { combineReducers } from 'redux';
import movies from './movies_reducer';
const rootReducer = combineReducers({
movies
})
export de
我已经导入了react,但是找不到它。我用RN cli。(它在世博cli中工作得很好,但我复制并粘贴代码以转换为不弹出)请帮助我~谢谢!!
This error is located at:
in RootNavigator (at App.js:12)
in EnsureSingleNavigator (at BaseNavigationContainer.tsx:430)
in BaseNavigationContainer (at NavigationContainer.tsx:132)
in Theme
我正在使用JSPM/SystemJS/BabelJS将一些代码转换为ES6语法。
我有以下几点:
// main.js:
console.log('foo');
import * as Backbone from 'backbone';
import * as Cocktail from 'backbone.cocktail';
Cocktail.patch(Backbone);
console.log('bar');
import Application from 'background/application'
下面是我在网页检查控制台中遇到的错误:
Uncaught SyntaxError: Unexpected token {
at Object.<anonymous> (main.bundle.js:3885)
at __webpack_require__ (polyfills.bundle.js:51)
at eval (eval at <anonymous> (main.bundle.js:2268), <anonymous>:7:15)
at Object.<anonymous> (main.bundle.js
我正在开发一个货币转换应用程序,我从代码笔()那里得到了代码。我正在尝试运行此代码,并收到此错误:./src/index.js尝试导入错误:'App‘不是从'./App’导出的。
我已经尝试在index.js和App.js文件上添加导出默认应用程序();,但不起作用。
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import {App} from './App';
import * as ser
我正在尝试注入一个模块
transformer.ts导入语句
(*我用了打字本,效果很好,
但有些陈述没有得到解释。)
我成功地插入了import语句
但是我注射的进口声明
没有间歇地转换为es5语法。
这是我在转染中使用的代码。
transformer.ts
let moduleName = 'infinite.js'
let variableName = ts.createUniqueName('infinite')
ctx.hoistVariableDeclaration('infinite')
// Here are just a fe
我是一个反应本地人的初学者,所以我道歉,如果这是一个菜鸟的问题。我正在尝试学习使用和。第一篇文章将所有代码放在App.js中,而第二篇文章将代码放在单独的页面中,但有点过时。因此,我的计划是将这两个示例集成起来,使用第一篇文章的代码,但在单独的页面中,而不是将所有内容都放在App.js中。
我所犯的错误:
None of these files exist:
* Screen\drawerScreens\settingsScreen(.native|.android.js|.native.js|.js|.android.json|.native.json|.json|.android.t
如何创建一个可以在ReactJS中消费的webpack库ES6。喜欢
-----lib.js-----
export function sum(a , b) {
return a + b;
};
export function multiply(a, b) {
return a * b;
};
我想使用像这样的import语句进行消费:
import lib from './lib';
console.log(lib.sum(3,5));
我使用下面的代码作为webpack.config.babel.js
export default () => (
我想显示一个工具提示。我去了ng-引导程序并集成了那个代码。得到控制台错误。
core.es5.js:1020 ERROR Error: Uncaught (in promise): Error: No provider for
NgbTooltipConfig!
Error: No provider for NgbTooltipConfig!
at injectionError (core.es5.js:1169)
at noProviderError (core.es5.js:1207)
at ReflectiveInjector_._throwOrNull (core.es5.js:2
我有一个NgUpgrade应用,我正在从Angular.js的UI-Router迁移到Angular的Router,一切都很顺利,直到我引入了一个延迟加载的模块。然后,在延迟加载模块的一个组件中,我得到了以下代码: Found an error while navigating to /my-lazy-feature error: TypeError: Cannot read property 'get' of undefined
at new MyComponent (my.component.ts:86)
at NodeInjectorFactory.My
我已经决定将js项目迁移到ts中,但是我面临以下问题: ts文件中的所有导入都缺少已编译的js文件中的.js扩展名。这反过来会引发以下错误:我的浏览器控制台上的Loading failed for the module with source “http://localhost:5500/build/test/first”.。这是代码
/src/index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta nam