Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to load resource: the server responded with a status of 404 (Not Found) #27

Closed
wangjiandev opened this issue Apr 8, 2022 · 7 comments

Comments

@wangjiandev
Copy link

Failed to load resource: the server responded with a status of 404 (Not Found)

package.json

 "devDependencies": {
    "@vitejs/plugin-vue": "^2.3.0",
    "autoprefixer": "^10.4.4",
    "cesium": "^1.92.0",
    "postcss": "^8.4.12",
    "tailwindcss": "^3.0.23",
    "typescript": "^4.5.4",
    "vite": "^2.9.0",
    "vite-plugin-cesium": "^1.2.15",
    "vue-tsc": "^0.29.8"
  }

vite.config.ts


import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import cesium from 'vite-plugin-cesium'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [cesium(), vue()],
})

启动没有错误,打开页面提示没有找到css文件

@wangjiandev
Copy link
Author

GET http://localhost:3000/cesium/Widgets/widgets.css net::ERR_ABORTED 404 (Not Found)

@wangjiandev
Copy link
Author

cesium 1.92.0 版本下载的 npm包中不存在Widgets目录,请问一下怎么解决?

@nshen
Copy link
Owner

nshen commented Apr 8, 2022

难道是cesium版本更新的问题?我记得1.86好像还可以呢,有空看一下

@nshen
Copy link
Owner

nshen commented Apr 9, 2022

hi @wangjiandev 我新建了个 vite 、cesium、vite-plugin-cesium 都升级到最新版本了,我这里没看到任何错误呀,你那边能试一下吗

https://github.com/nshen/cesium-mini-example

@wangjiandev
Copy link
Author

hi @wangjiandev 我新建了个 vite 、cesium、vite-plugin-cesium 都升级到最新版本了,我这里没看到任何错误呀,你那边能试一下吗

https://github.com/nshen/cesium-mini-example

我尝试了一下
根据您的文档,我在mac下操作没有任何问题,但是window不行.
然后我在mac下创建一个没有问题的,git clone到window下,依旧不行,真的很奇怪

@nshen
Copy link
Owner

nshen commented Apr 9, 2022

@wangjiandev 我暂时没有windows环境,能帮忙看一下我刚发的 vite-plugin-cesium@1.2.16-alpha.0 这个版本在windows下可不可以吗?

版本号放在package.json里重新 install 一下

@wangjiandev
Copy link
Author

@wangjiandev 我暂时没有windows环境,能帮忙看一下我刚发的 vite-plugin-cesium@1.2.16-alpha.0 这个版本在windows下可不可以吗?

版本号放在package.json里重新 install 一下

"vite-plugin-cesium": "1.2.16-alpha.0",
这个版本可以,在windos下删除node_modules,重新安装后发现可用了,没有问题
非常感谢

nshen added a commit that referenced this issue Apr 9, 2022
- Fix: load widgets.css failed on windows #27

Thanks @wangjiandev
nshen added a commit that referenced this issue Apr 9, 2022
- Fix: load widgets.css failed on windows #27

Thanks @wangjiandev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants