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

MkTimeでNODE_ENV=production pnpm install; pnpm run buildすると Rollup failed to resolve import "chromatic/isChromatic" #10609

Closed
tamaina opened this issue Apr 13, 2023 · 12 comments · Fixed by #10613
Labels
🐛Bug Unexpected behavior packages/frontend Client side specific issue/PR

Comments

@tamaina
Copy link
Contributor

tamaina commented Apr 13, 2023

No description provided.

@tamaina tamaina added the ⚠️bug? This might be a bug label Apr 13, 2023
@tamaina
Copy link
Contributor Author

tamaina commented Apr 13, 2023

#10475 が原因

@tamaina
Copy link
Contributor Author

tamaina commented Apr 13, 2023

@acid-chicken

@tamaina
Copy link
Contributor Author

tamaina commented Apr 13, 2023

[vite]: Rollup failed to resolve import "chromatic/isChromatic" from "/home/aqz/misskey/packages/frontend/src/components/global/MkTime.vue?vue&type=script&setup=true&lang.ts".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
`build.rollupOptions.external`
error during build:
Error: [vite]: Rollup failed to resolve import "chromatic/isChromatic" from "/home/aqz/misskey/packages/frontend/src/components/global/MkTime.vue?vue&type=script&setup=true&lang.ts".

@tamaina tamaina added 🐛Bug Unexpected behavior packages/frontend Client side specific issue/PR and removed ⚠️bug? This might be a bug labels Apr 13, 2023
@acid-chicken
Copy link
Member

MkTime だけ一旦リバートしてよいかも

@acid-chicken
Copy link
Member

でも仮想モジュールとかではないはずなので謎(pnpm i したよね?)

@tamaina tamaina changed the title NODE_ENV=production pnpm install; pnpm run buildすると Rollup failed to resolve import "chromatic/isChromatic" MkTimeでNODE_ENV=production pnpm install; pnpm run buildすると Rollup failed to resolve import "chromatic/isChromatic" Apr 13, 2023
@tamaina
Copy link
Contributor Author

tamaina commented Apr 13, 2023

7d11cf8

とりあえず修正した

@tamaina
Copy link
Contributor Author

tamaina commented Apr 13, 2023

(pnpm i したよね?)

NODE_ENV=production pnpm install;

@acid-chicken
Copy link
Member

あー

@acid-chicken
Copy link
Member

プロダクションビルド時に chromatic/isChromatic を問答無用で () => false にしたいなぁ

@tamaina
Copy link
Contributor Author

tamaina commented Apr 13, 2023

Viteでresolve.alias使うとかプラグイン作るとかするといけるとか

@acid-chicken
Copy link
Member

replace({
  'isChromatic()': JSON.stringify(false),
})

かな

@acid-chicken
Copy link
Member

これやったら dev じゃない dependencies に含めても副作用なさそう

tamaina added a commit that referenced this issue Apr 13, 2023
* perf: remove isChromatic on real build

* revert: Revert #10475 in MkTime

This reverts commit 7d11cf8.

* @rollup/plugin-replace as dependencies

* fix pnpm-lock,yaml

---------

Co-authored-by: tamaina <[email protected]>
na2na-p pushed a commit to na2na-p/misskey that referenced this issue May 10, 2023
…#10613)

* perf: remove isChromatic on real build

* revert: Revert misskey-dev#10475 in MkTime

This reverts commit 7d11cf8.

* @rollup/plugin-replace as dependencies

* fix pnpm-lock,yaml

---------

Co-authored-by: tamaina <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛Bug Unexpected behavior packages/frontend Client side specific issue/PR
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants