GuavaCZ / filament-knowledge-base

MIT License
144 stars 21 forks source link

[Bug]: Cannot find package 'tm-grammars' #58

Closed mrvnklm closed 2 months ago

mrvnklm commented 2 months ago

What happened?

I get the following error when using syntax highlighting: The command "'/usr/local/bin/node' 'grammars.js' 'text'" failed. Exit Code: 1(General error) Working directory: /Users/mrvn/main-a11y/vendor/guava/filament-knowledge-base/bin Output: ================ Error Output: ================ node:internal/modules/esm/resolve:839 throw new ERR_MODULE_NOT_FOUND(packageName, fileURLToPath(base), null); ^ Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'tm-grammars' imported from /Users/mrvn/main-a11y/vendor/guava/filament-knowledge-base/bin/grammars.js at packageResolve (node:internal/modules/esm/resolve:839:9) at moduleResolve (node:internal/modules/esm/resolve:908:18) at defaultResolve (node:internal/modules/esm/resolve:1038:11) at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:554:12) at ModuleLoader.resolve (node:internal/modules/esm/loader:523:25) at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:246:38) at onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:481:36) at TracingChannel.tracePromise (node:diagnostics_channel:337:14) at ModuleLoader.import (node:internal/modules/esm/loader:480:21) at defaultImportModuleDynamicallyForModule (node:internal/modules/esm/utils:214:31) { code: 'ERR_MODULE_NOT_FOUND' } Node.js v22.8.0

How to reproduce the bug

using a code section in markdown causes the error, shiki php and shiki are installed

Package Version

1.10.0

PHP Version

8.3.11

Laravel Version

11.23.5

Which operating systems does with happen with?

No response

Notes

No response

lukas-frey commented 2 months ago

Hi, thanks for the info, missing documentation step I suppose.

Please run npm install tm-grammars and clear your cache if the error persists. This is only required when using shiki and the syntax highlighter and is used to get the correct short / long name of the syntax highlighted language.