tannercollin / Notica

Send browser notifications from your terminal. No installation. No registration.
https://notica.us
MIT License
344 stars 22 forks source link

BabelLoader unexpected token #36

Open jakobfriis opened 2 years ago

jakobfriis commented 2 years ago

Using yarn on Ubuntu, with the supplied package.json, there seems to be a problem with the setup

jfr@dockerhost:~/docker/notica.dk$ yarn start --host 0.0.0.0 yarn run v1.22.17 $ yarn run build && node server.js --host 0.0.0.0 $ webpack --config ./webpack.production.config.js --profile --display-error-details --no-color Hash: 0c34ed32dc97cdb5d755 Version: webpack 1.15.0 Time: 593ms [0] multi main 28 bytes {0} [built] [1 error] factory:0ms building:1ms = 1ms

ERROR in ./src/index.js Module build failed: SyntaxError: Unexpected token (6:1)

4 | 5 | React.render((

6 | | ^ 7 | 8 | 9 | ), document.getElementById('root'));

BabelLoaderError: SyntaxError: Unexpected token (6:1)

4 | 5 | React.render((

6 | | ^ 7 | 8 | 9 | ), document.getElementById('root'));

at transpile (/home/jfr/docker/notica.dk/node_modules/babel-loader/lib/index.js:61:13)
at Object.module.exports (/home/jfr/docker/notica.dk/node_modules/babel-loader/lib/index.js:163:20)

@ multi main ==> Listening on port 3000. Open up http://0.0.0.0:3000/ in your browser.

Any ideas ? The page is blank, when opening it.

tannercollin commented 2 years ago

This is strange. I wonder if it's because of different yarn / node versions?

I wrote it on yarn v1.17.3 and node v10.24.1. Can you try those versions?

jakobfriis commented 2 years ago

Thanks for the reply. Unfortunately it does not help.

npm version { Notica: '1.2.0', npm: '6.14.12', ares: '1.15.0', brotli: '1.0.7', cldr: '35.1', http_parser: '2.9.4', icu: '64.2', modules: '64', napi: '7', nghttp2: '1.41.0', node: '10.24.1', openssl: '1.1.1k', tz: '2019c', unicode: '12.1', uv: '1.34.2', v8: '6.8.275.32-node.59', zlib: '1.2.11' }

yarn install && yarn start --host 0.0.0.0 yarn install v1.17.3 warning package-lock.json found. Your project contains lock files generated by t ools other than Yarn. It is advised not to mix package managers in order to avoi d resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json. [1/4] Resolving packages... success Already up-to-date. Done in 0.76s. yarn run v1.17.3 $ yarn run build && node server.js --host 0.0.0.0 $ webpack --config ./webpack.production.config.js --profile --display-error-deta ils --no-color Hash: 0c34ed32dc97cdb5d755 Version: webpack 1.15.0 Time: 564ms [0] multi main 28 bytes {0} [built] [1 error] factory:0ms building:1ms = 1ms

ERROR in ./src/index.js Module build failed: SyntaxError: Unexpected token (6:1)

4 | 5 | React.render((

6 | | ^ 7 | 8 | 9 | ), document.getElementById('root'));

BabelLoaderError: SyntaxError: Unexpected token (6:1)

4 | 5 | React.render((

6 | | ^ 7 | 8 | 9 | ), document.getElementById('root'));

at transpile (/home/jfr/docker/notica.dk/node_modules/babel-loader/lib/index                                   .js:61:13)
at Object.module.exports (/home/jfr/docker/notica.dk/node_modules/babel-load                                   er/lib/index.js:163:20)

@ multi main ==> Listening on port 3000. Open up http://0.0.0.0:3000/ in your browser.

tannercollin commented 2 years ago

It works perfectly first try for me:

[Thu Jan 20 05:07 PM] tanner@tannerlaptop:~/work
└─► git clone git@github.com:tannercollin/Notica.git
Cloning into 'Notica'...
Warning: Permanently added the RSA host key for IP address '140.82.112.3' to the list of known hosts.
Enter passphrase for key '/home/tanner/.ssh/id_ed25519': 
remote: Enumerating objects: 476, done.
remote: Counting objects: 100% (92/92), done.
remote: Compressing objects: 100% (82/82), done.
remote: Total 476 (delta 46), reused 28 (delta 10), pack-reused 384
Receiving objects: 100% (476/476), 484.09 KiB | 1.59 MiB/s, done.
Resolving deltas: 100% (245/245), done.
[Thu Jan 20 05:07 PM] tanner@tannerlaptop:~/work
└─► cd Notica
[Thu Jan 20 05:08 PM] tanner@tannerlaptop:~/work/Notica
└─► yarn install
yarn install v1.22.4
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@1.2.9: The platform "linux" is incompatible with this module.
info "fsevents@1.2.9" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning " > react-router@2.8.1" has incorrect peer dependency "react@^0.14.0 || ^15.0.0".
warning " > eslint-plugin-react@2.7.1" has unmet peer dependency "eslint@>=0.8.0 || ~1.0.0-rc-0".
warning " > webpack-dev-server@3.7.2" has incorrect peer dependency "webpack@^4.0.0".
warning "webpack-dev-server > webpack-dev-middleware@3.7.0" has incorrect peer dependency "webpack@^4.0.0".
[4/4] Building fresh packages...
warning Your current version of Yarn is out of date. The latest version is "1.22.17", while you're on "1.22.4".
info To upgrade, run the following command:
$ curl --compressed -o- -L https://yarnpkg.com/install.sh | bash
Done in 3.29s.
[Thu Jan 20 05:08 PM] tanner@tannerlaptop:~/work/Notica
└─► yarn start
yarn run v1.22.4
$ yarn run build && node server.js
$ webpack --config ./webpack.production.config.js --profile --display-error-details --no-color
Hash: d6d501cab2425711abd9
Version: webpack 1.15.0
Time: 3888ms
        Asset       Size  Chunks             Chunk Names
    bundle.js     285 kB       0  [emitted]  main
bundle.js.map  177 bytes       0  [emitted]  main
   [0] multi main 28 bytes {0} [built]
       factory:0ms building:0ms = 0ms
    + 292 hidden modules
==> Listening on port 3000. Open up http://127.0.0.1:3000/ in your browser.
2022-01-20T17:11:14-07:00: New connection from 127.0.0.1
2022-01-20T17:11:14-07:00: New connection joining room: pOZlMw

This is strange. Can you do git diff or something to see if any of the files changed?

tannercollin commented 2 years ago

Try checking it out to a different directory and following the exact steps again.