无法在离子 3 中使用日期选取器



>我正在尝试在我的 ionic 3 应用程序中使用 ngx 日期选择器,但我收到这些错误

Refused to apply style from 'http://localhost:8100/build/main.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
vendor.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
main.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
(index):1 Refused to apply style from 'http://localhost:8100/build/main.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
vendor.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
main.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
(index):1 Refused to apply style from 'http://localhost:8100/build/main.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.

My Package.json 是

{
"name": "HelloWorld",
"version": "0.0.1",
"author": "Ionic Framework",
"homepage": "http://ionicframework.com/",
"private": true,
"scripts": {
"start": "ionic-app-scripts serve",
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"lint": "ionic-app-scripts lint"
},
"dependencies": {
"@angular/animations": "^5.2.11",
"@angular/cdk": "5.2.4",
"@angular/common": "5.2.11",
"@angular/compiler": "5.2.11",
"@angular/compiler-cli": "5.2.11",
"@angular/core": "5.2.11",
"@angular/http": "5.2.11",
"@angular/material": "^8.1.4",
"@angular/platform-browser": "5.2.11",
"@angular/platform-browser-dynamic": "5.2.11",
"@ionic-native/core": "~4.17.0",
"@ionic-native/geolocation": "^4.18.0",
"@ionic-native/splash-screen": "~4.17.0",
"@ionic-native/status-bar": "~4.17.0",
"@ionic/storage": "2.2.0",
"cordova-plugin-geolocation": "4.0.1",
"ionic-angular": "3.9.2",
"ionicons": "3.0.0",
"ng-pick-datetime": "^7.0.0",
"rxjs": "5.5.11",
"sw-toolbox": "3.6.0",
"zone.js": "0.8.26"
},
"devDependencies": {
"@angular/forms": "^5.2.11",
"@ionic/app-scripts": "3.2.0",
"typescript": "~2.6.2"
},
"description": "An Ionic project",
"cordova": {
"plugins": {
"cordova-plugin-geolocation": {}
}
}
}

我认为这与版本不兼容有关,但我无法弄清楚是哪个包导致了它. 任何帮助将不胜感激。

通过使用我的超级英雄力量,我,阅读文档的人,已经推断出你正在使用Angular 5。

顶部有一个注释,说明您需要与该软件包一起使用哪个版本:

选取器已针对 Angular 6+ 应用程序进行了更新。如果您仍在使用 Angular 5,则应安装选取器版本 5.2.6。npm install ng-pick-datetime@5.2.6 --save

但是您的包裹说您正在使用犯罪高"ng-pick-datetime": "^7.0.0",.

回归你的方式,回到光明。

祝你的发展好运,公民!

更新

并且不要忘记遵循该特定版本的设置指南,因为Ionic 4中的情况发生了很大变化。

相关内容

  • 没有找到相关文章

最新更新