gpt4 book ai didi

javascript - ionic 2 : ReferenceError: webpackJsonp is not defined

转载 作者:IT王子 更新时间:2023-10-29 02:59:13 32 4
gpt4 key购买 nike

我是 Ionic 的新手。我已经开始使用 super 模板进行项目。但是当我尝试在浏览器中运行该应用程序时。它抛出一个错误说:

ReferenceError: webpackJsonp is not defined
at http://localhost:8100/build/main.js:1:1

我试过将 vendor.js 放在 index.html 中,但没有成功。

这是 index.html 文件。我已删除 vendor.js,因为它不起作用。

<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="UTF-8">
<title>Ionic App</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="format-detection" content="telephone=no">
<meta name="msapplication-tap-highlight" content="no">

<link rel="icon" type="image/x-icon" href="assets/icon/favicon.ico">
<link rel="manifest" href="manifest.json">
<meta name="theme-color" content="#4e8ef7">

<!-- cordova.js required for cordova apps -->
<script src="cordova.js"></script>

<!-- un-comment this code to enable service worker
<script>
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('service-worker.js')
.then(() => console.log('service worker installed'))
.catch(err => console.log('Error', err));
}
</script>-->

<link href="build/main.css" rel="stylesheet">

</head>
<body>

<!-- Ionic's root component and where the app will load -->
<ion-app></ion-app>

<!-- The polyfills js is generated during the build process -->
<script src="build/polyfills.js"></script>

<!-- The bundle js is generated during the build process -->
<script src="build/main.js"></script>

</body>
</html>

最佳答案

从字面上看,只是经历了与您相同的事情。我在 /src/index.html 中的 main.js 之前添加了 vendor.js 脚本 - 现在它在本地运行。

  <!-- The polyfills js is generated during the build process -->
<script src="build/polyfills.js"></script>

<script src="build/vendor.js"></script>

<!-- The bundle js is generated during the build process -->
<script src="build/main.js"></script>

关于javascript - ionic 2 : ReferenceError: webpackJsonp is not defined,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44988166/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com