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

protobufjs new version 7.3.1 delete dist dir, cesium run error. #12034

Closed
FrozenJun opened this issue Jun 12, 2024 · 6 comments
Closed

protobufjs new version 7.3.1 delete dist dir, cesium run error. #12034

FrozenJun opened this issue Jun 12, 2024 · 6 comments

Comments

@FrozenJun
Copy link

What happened?

I installed Cesium in the new Vite project,
when pnpm dev send an error:
Could not resolve "protobufjs/dist/minimal/protobuf.js"
../../node_modules/.pnpm/@cesium+engine@9.2.0/node_modules/@cesium/engine/Source/Core/GoogleEarthEnterpriseMetadata.js:1:26:
1 │ ...rt * as protobuf from "protobufjs/dist/minimal/protobuf.js";

I found that @cesium/engine depends on protobufjs: ^7.1.0. There is a dist directory in this version, and there was also one until version 7.3.0, but the latest protobufjs 7.3.1 deleted the dist directory. I solved this problem by configuring
"resolutions": {
"protobufjs": "7.3.0"
}
in package.json, but it would be better to lock the protobufjs version to solve this problem.

Reproduction steps

  1. pnpm i cesium
  2. pnpm dev
  3. show error
    ...

Sandcastle example

No response

Environment

Browser: chrome@latest
CesiumJS Version: 1.118.1
Operating System: Windows11

@s3xysteak
Copy link
Contributor

s3xysteak commented Jun 12, 2024

It also happened in v1.118.2 😭 .

versions:
pnpm v9.1.2
OS win10

It has been fixed in protobufjs@7.3.2.

@akirin103
Copy link

I encountered the same issue.

Cesium version: v1.118.2
OS: macOS Sonoma 14.5
npm: 10.2.4

As @FrozenJun mentioned, the latest protobufjs release does not seem to include a dist directory.
This is noted in the following issue

protobufjs/protobuf.js#2004

@claustres
Copy link

The error can appear as well in previous version of Cesium, e.g. 115. As far as I can see the problem is not related to the Cesium version but the fact that it does not use a .lock file for dependencies so that this specification will allow to install a newer version of protobufjs if available. The trick provided by @FrozenJun is the way to go unless Cesium uses npm lock files.

@FrozenJun
Copy link
Author

protobufjs7.3.2 version fixes this problem,it`s over now

@cfairbanks
Copy link

protobufjs 7.3.3 looks to have re-introduced this bug by removing the dist directory again.

https://cdn.jsdelivr.net/npm/protobufjs@7.3.3/

@stevethewright
Copy link

Can confirm this is now happening on Cesium Version v1.120 due to protobufjs removing the dist folder in v7.3.3.

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

No branches or pull requests

6 participants