docusaurus-search-local icon indicating copy to clipboard operation
docusaurus-search-local copied to clipboard

Webpack fatal error

Open tisonkun opened this issue 1 year ago • 2 comments

A number of webpack failures occur when I try to use this theme:

Module parse failed: Unexpected character '�' (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
(Source code omitted for this binary file)
Module not found: Error: Can't resolve 'fs' in '/Users/chenzili/Brittani/pulsar-site/site2/website-next/node_modules/@node-rs/jieba'
Module not found: Error: Can't resolve 'path' in '/Users/chenzili/Brittani/pulsar-site/site2/website-next/node_modules/@node-rs/jieba'
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:
	- add a fallback 'resolve.fallback: { "path": require.resolve("path-browserify") }'
	- install 'path-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
	resolve.fallback: { "path": false }
Module not found: Error: Can't resolve 'fs' in '/Users/chenzili/Brittani/pulsar-site/site2/website-next/node_modules/@nodelib/fs.scandir/out/adapters'
Did you mean './fs'?

...

Reproduce

https://github.com/tisonkun/pulsar-site/tree/try-local-search

cd site2/website-next
./preview.sh 2.10.x 2.9.x

tisonkun avatar Dec 06 '22 02:12 tisonkun