streetwriters / notesnook

A fully open source & end-to-end encrypted note taking alternative to Evernote.
https://notesnook.com/
GNU General Public License v3.0
10.18k stars 628 forks source link

monograph build fail #6892

Open dyw770 opened 1 day ago

dyw770 commented 1 day ago

What happened?

The console throws the following error while executing the monomer build:

failed to load config from D:\study\idea\notesnook\apps\monograph\vite.config.ts
TypeError [ERR_IMPORT_ASSERTION_TYPE_MISSING]: Module "file:///D:/study/idea/notesnook/packages/theme/dist/esm/theme-engine/themes/default-dark.json" needs an import attribute of type "json"

I tested the question and it may be caused by a change in the package.json configuration in the package/theme module

Steps to reproduce the problem

cd apps/monograph
npm run build

Version

current version

Platform/OS

Windows

Relevant log output

dyw770 commented 20 hours ago

https://github.com/streetwriters/notesnook/blob/8f2113b1557298ca0152cca77b50a8b5c5c01bce/packages/theme/src/theme-engine/index.ts#L22-L23

https://github.com/streetwriters/notesnook/blob/8f2113b1557298ca0152cca77b50a8b5c5c01bce/packages/theme/src/theme-engine/utils.ts#L30-L31

monographIt seems that these lines of code caused the compile failure of the monograph. I tried to modify the code as follows to compile the monograph normally.

import _ThemeLight from "./themes/default-light.json" with {type: "json"};
import _ThemeDark from "./themes/default-dark.json" with {type: "json"};

If you are willing, I am willing to submit a PR