cerebroapp / cerebro

🔵 Cerebro is an open-source launcher to improve your productivity and efficiency
https://www.cerebroapp.com/
MIT License
8.33k stars 455 forks source link

Module parse failed: Unexpected character '�' (1:0) #667

Open faressoft opened 1 year ago

faressoft commented 1 year ago

I followed the steps here: https://github.com/cerebroapp/cerebro#build-executable-from-source

I'm using MacOS 13.5 (22G74) with Node.js v18.16.1

But when I run yarn package I get this error:

yarn run v1.22.19
$ yarn build && npx electron-builder
$ run-p build-main build-renderer
$ webpack --config webpack.config.production.js
$ webpack --mode production --config webpack.config.electron.js
asset ./main.js 411 KiB [compared for emit] [minimized] (name: main) 2 related assets
asset main/css/themes/dark.css 1.17 KiB [compared for emit] [from: app/main/css/themes/dark.css] [copied]
asset main/css/themes/light.css 1.16 KiB [compared for emit] [from: app/main/css/themes/light.css] [copied]
orphan modules 16.4 KiB [orphan] 13 modules
runtime modules 1.04 KiB 5 modules
modules by path ./app/node_modules/ 975 KiB
  javascript modules 972 KiB 266 modules
  json modules 3.07 KiB
    ./app/node_modules/ajv/dist/refs/json-schema-draft-07.json 2.72 KiB [built] [code generated]
    ./app/node_modules/ajv/dist/refs/data.json 360 bytes [built] [code generated]
modules by path ./node_modules/ 3.01 KiB
  ./node_modules/supports-color/index.js 2.68 KiB [built] [code generated]
  ./node_modules/has-flag/index.js 330 bytes [built] [code generated]
+ 17 modules
webpack 5.75.0 compiled successfully in 2907 ms
assets by status 2.04 MiB [cached] 6 assets
Entrypoint main = main.css main.bundle.js 2 auxiliary assets
Entrypoint background = background.css background.bundle.js 2 auxiliary assets
orphan modules 970 KiB (javascript) 6.41 KiB (runtime) [orphan] 352 modules
runtime modules 2.07 KiB 10 modules
javascript modules 3.75 MiB
  modules by path ./app/node_modules/ 2.4 MiB 387 modules
  modules by path ./app/main/ 902 KiB 4 modules
  + 14 modules
css modules 21.6 KiB
  modules by path ./app/main/ 7.98 KiB 6 modules
  modules by path ./app/node_modules/ 10.8 KiB 2 modules
  modules by path ./app/plugins/ 2.83 KiB 2 modules
json modules 4.68 KiB
  ./app/node_modules/binary-extensions/binary-extensions.json 1.61 KiB [built] [code generated]
  ./app/node_modules/ajv/dist/refs/json-schema-draft-07.json 2.72 KiB [built] [code generated]
  ./app/node_modules/ajv/dist/refs/data.json 360 bytes [built] [code generated]

WARNING in ./app/node_modules/simple-plist/dist/index.js 6:24-31
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
 @ ./app/main/components/SmartIcon/getFileIcon/mac.ts 16:16-39
 @ ./app/main/components/SmartIcon/getFileIcon/index.ts 11:16-32
 @ ./app/main/components/SmartIcon/index.tsx 5:0-40 32:14-25
 @ ./app/main/components/ResultsList/Row/index.tsx 2:0-40 22:46-55
 @ ./app/main/components/ResultsList/index.js 6:0-24 43:44-47
 @ ./app/main/components/Cerebro/index.js 13:0-41 342:40-51
 @ ./app/main/main.js 9:0-43 30:36-43

WARNING in ./app/node_modules/simple-plist/dist/parse.js 6:24-31
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
 @ ./app/node_modules/simple-plist/dist/index.js
 @ ./app/main/components/SmartIcon/getFileIcon/mac.ts 16:16-39
 @ ./app/main/components/SmartIcon/getFileIcon/index.ts 11:16-32
 @ ./app/main/components/SmartIcon/index.tsx 5:0-40 32:14-25
 @ ./app/main/components/ResultsList/Row/index.tsx 2:0-40 22:46-55
 @ ./app/main/components/ResultsList/index.js 6:0-24 43:44-47
 @ ./app/main/components/Cerebro/index.js 13:0-41 342:40-51
 @ ./app/main/main.js 9:0-43 30:36-43

WARNING in ./app/node_modules/simple-plist/dist/readFile.js 6:24-31
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
 @ ./app/node_modules/simple-plist/dist/index.js
 @ ./app/main/components/SmartIcon/getFileIcon/mac.ts 16:16-39
 @ ./app/main/components/SmartIcon/getFileIcon/index.ts 11:16-32
 @ ./app/main/components/SmartIcon/index.tsx 5:0-40 32:14-25
 @ ./app/main/components/ResultsList/Row/index.tsx 2:0-40 22:46-55
 @ ./app/main/components/ResultsList/index.js 6:0-24 43:44-47
 @ ./app/main/components/Cerebro/index.js 13:0-41 342:40-51
 @ ./app/main/main.js 9:0-43 30:36-43

WARNING in ./app/node_modules/simple-plist/dist/readFileSync.js 6:24-31
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
 @ ./app/node_modules/simple-plist/dist/index.js
 @ ./app/main/components/SmartIcon/getFileIcon/mac.ts 16:16-39
 @ ./app/main/components/SmartIcon/getFileIcon/index.ts 11:16-32
 @ ./app/main/components/SmartIcon/index.tsx 5:0-40 32:14-25
 @ ./app/main/components/ResultsList/Row/index.tsx 2:0-40 22:46-55
 @ ./app/main/components/ResultsList/index.js 6:0-24 43:44-47
 @ ./app/main/components/Cerebro/index.js 13:0-41 342:40-51
 @ ./app/main/main.js 9:0-43 30:36-43

WARNING in ./app/node_modules/simple-plist/dist/stringify.js 6:24-31
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
 @ ./app/node_modules/simple-plist/dist/index.js
 @ ./app/main/components/SmartIcon/getFileIcon/mac.ts 16:16-39
 @ ./app/main/components/SmartIcon/getFileIcon/index.ts 11:16-32
 @ ./app/main/components/SmartIcon/index.tsx 5:0-40 32:14-25
 @ ./app/main/components/ResultsList/Row/index.tsx 2:0-40 22:46-55
 @ ./app/main/components/ResultsList/index.js 6:0-24 43:44-47
 @ ./app/main/components/Cerebro/index.js 13:0-41 342:40-51
 @ ./app/main/main.js 9:0-43 30:36-43

WARNING in ./app/node_modules/simple-plist/dist/writeBinaryFile.js 6:24-31
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
 @ ./app/node_modules/simple-plist/dist/index.js
 @ ./app/main/components/SmartIcon/getFileIcon/mac.ts 16:16-39
 @ ./app/main/components/SmartIcon/getFileIcon/index.ts 11:16-32
 @ ./app/main/components/SmartIcon/index.tsx 5:0-40 32:14-25
 @ ./app/main/components/ResultsList/Row/index.tsx 2:0-40 22:46-55
 @ ./app/main/components/ResultsList/index.js 6:0-24 43:44-47
 @ ./app/main/components/Cerebro/index.js 13:0-41 342:40-51
 @ ./app/main/main.js 9:0-43 30:36-43

WARNING in ./app/node_modules/simple-plist/dist/writeBinaryFileSync.js 6:24-31
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
 @ ./app/node_modules/simple-plist/dist/index.js
 @ ./app/main/components/SmartIcon/getFileIcon/mac.ts 16:16-39
 @ ./app/main/components/SmartIcon/getFileIcon/index.ts 11:16-32
 @ ./app/main/components/SmartIcon/index.tsx 5:0-40 32:14-25
 @ ./app/main/components/ResultsList/Row/index.tsx 2:0-40 22:46-55
 @ ./app/main/components/ResultsList/index.js 6:0-24 43:44-47
 @ ./app/main/components/Cerebro/index.js 13:0-41 342:40-51
 @ ./app/main/main.js 9:0-43 30:36-43

WARNING in ./app/node_modules/simple-plist/dist/writeFile.js 6:24-31
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
 @ ./app/node_modules/simple-plist/dist/index.js
 @ ./app/main/components/SmartIcon/getFileIcon/mac.ts 16:16-39
 @ ./app/main/components/SmartIcon/getFileIcon/index.ts 11:16-32
 @ ./app/main/components/SmartIcon/index.tsx 5:0-40 32:14-25
 @ ./app/main/components/ResultsList/Row/index.tsx 2:0-40 22:46-55
 @ ./app/main/components/ResultsList/index.js 6:0-24 43:44-47
 @ ./app/main/components/Cerebro/index.js 13:0-41 342:40-51
 @ ./app/main/main.js 9:0-43 30:36-43

WARNING in ./app/node_modules/simple-plist/dist/writeFileSync.js 6:24-31
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
 @ ./app/node_modules/simple-plist/dist/index.js
 @ ./app/main/components/SmartIcon/getFileIcon/mac.ts 16:16-39
 @ ./app/main/components/SmartIcon/getFileIcon/index.ts 11:16-32
 @ ./app/main/components/SmartIcon/index.tsx 5:0-40 32:14-25
 @ ./app/main/components/ResultsList/Row/index.tsx 2:0-40 22:46-55
 @ ./app/main/components/ResultsList/index.js 6:0-24 43:44-47
 @ ./app/main/components/Cerebro/index.js 13:0-41 342:40-51
 @ ./app/main/main.js 9:0-43 30:36-43

9 warnings have detailed information that is not shown.
Use 'stats.errorDetails: true' resp. '--stats-error-details' to show it.

ERROR in ./app/node_modules/fsevents/fsevents.node 1:0
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)
 @ ./app/node_modules/fsevents/fsevents.js 13:15-41
 @ ./app/node_modules/chokidar/lib/fsevents-handler.js 9:13-32
 @ ./app/node_modules/chokidar/index.js 15:24-57
 @ ./app/plugins/externalPlugins.js 2:0-32 52:25-39 92:22-36
 @ ./app/plugins/index.ts 2:0-48 5:28-43 6:2-17
 @ ./app/background/background.js 3:0-30 13:6-13

webpack 5.75.0 compiled with 1 error and 9 warnings in 9290 ms
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
ERROR: "build-renderer" exited with 1.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
ogustavo-pereira commented 1 year ago

Sorry but I don't have a mac OS to be able to test this problem, I will need help to solve this.

sinolnil commented 1 month ago

I fixed it by switching to node-loader.

add these code in to the rules in webpack.config.base.js

{ test: /\.node$/, use: "node-loader", },