Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add website node modules install step to bonnie setup #97

Merged
merged 1 commit into from
Jan 2, 2022

Conversation

phaleth
Copy link
Contributor

@phaleth phaleth commented Dec 22, 2021

Without the npm i --prefix ./website step prior to bonnie site run an error as bellow is thrown and styles on the website are all out of place.

(node:17003) UnhandledPromiseRejectionWarning: Error: Cannot find module 'tailwindcss/defaultTheme'
Require stack:
- /home/user/perseus/website/tailwind.config.js
- /home/user/emsdk/node/14.15.5_64bit/lib/node_modules/tailwindcss/lib/cli.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (/home/user/perseus/website/tailwind.config.js:1:22)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:17003) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:17003) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

@arctic-hen7
Copy link
Member

Wouldn't it be better to just add this command to the setup script in Bonnie?

@phaleth phaleth changed the title Add website node modules install instructions to contributing guidelines Add website node modules install step to bonnie setup Dec 27, 2021
@phaleth
Copy link
Contributor Author

phaleth commented Dec 27, 2021

Since the addition of concurrently I can't seem to be able to set the website up locally anymore. Keep running into a strange error and the result is that the bundle.js is missing.

user@debian:~/perseus$ bonnie setup
   Compiling perseus-cli v0.3.0 (/home/user/perseus/packages/perseus-cli)
    Finished dev [unoptimized + debuginfo] target(s) in 2.73s

up to date, audited 132 packages in 711ms

17 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
node:assert:123
  throw new AssertionError(obj);
  ^

AssertionError [ERR_ASSERTION]: [concurrently] no commands provided
    at module.exports (/home/user/.nvm/versions/node/v16.13.1/lib/node_modules/concurrently/src/concurrently.js:26:12)
    at exports (/home/user/.nvm/versions/node/v16.13.1/lib/node_modules/concurrently/index.js:23:12)
    at Object.<anonymous> (/home/user/.nvm/versions/node/v16.13.1/lib/node_modules/concurrently/bin/concurrently.js:163:1)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:17:47 {
  generatedMessage: false,
  code: 'ERR_ASSERTION',
  actual: 0,
  expected: 0,
  operator: 'notStrictEqual'
}
^C
user@debian:~/perseus$ ^C^C
user@debian:~/perseus$ bonnie site
[2] [Browsersync] Access URLs:
[2]  ----------------------------------
[2]        Local: http://localhost:8080
[2]     External: http://10.0.0.10:8080
[2]  ----------------------------------
[2]           UI: http://localhost:3001
[2]  UI External: http://localhost:3001
[2]  ----------------------------------
[2] [Browsersync] Serving files from: .perseus/dist/exported
[2] [Browsersync] Watching files...
[1] 
[1] Rebuilding...
[1] Done in 413ms.
[2] node:internal/errors:464
[2]     ErrorCaptureStackTrace(err);
[2]     ^
[2] 
[2] Error: ENOSPC: System limit for number of file watchers reached, watch '/home/user/perseus/website/.perseus/dist/static/en-US-docs%2Fadvanced%2Fsubsequent-loads.html'
[2]     at FSWatcher.<computed> (node:internal/fs/watchers:244:19)
[2]     at Object.watch (node:fs:2247:34)
[2]     at createFsWatchInstance (/home/user/.nvm/versions/node/v16.13.1/lib/node_modules/browser-sync/node_modules/chokidar/lib/nodefs-handler.js:119:15)
[2]     at setFsWatchListener (/home/user/.nvm/versions/node/v16.13.1/lib/node_modules/browser-sync/node_modules/chokidar/lib/nodefs-handler.js:166:15)
[2]     at NodeFsHandler._watchWithNodeFs (/home/user/.nvm/versions/node/v16.13.1/lib/node_modules/browser-sync/node_modules/chokidar/lib/nodefs-handler.js:331:14)
[2]     at NodeFsHandler._handleFile (/home/user/.nvm/versions/node/v16.13.1/lib/node_modules/browser-sync/node_modules/chokidar/lib/nodefs-handler.js:395:23)
[2]     at NodeFsHandler._addToNodeFs (/home/user/.nvm/versions/node/v16.13.1/lib/node_modules/browser-sync/node_modules/chokidar/lib/nodefs-handler.js:629:21)
[2] Emitted 'error' event on FSWatcher instance at:
[2]     at FSWatcher._handleError (/home/user/.nvm/versions/node/v16.13.1/lib/node_modules/browser-sync/node_modules/chokidar/index.js:647:10)
[2]     at NodeFsHandler._addToNodeFs (/home/user/.nvm/versions/node/v16.13.1/lib/node_modules/browser-sync/node_modules/chokidar/lib/nodefs-handler.js:637:18) {
[2]   errno: -28,
[2]   syscall: 'watch',
[2]   code: 'ENOSPC',
[2]   path: '/home/user/perseus/website/.perseus/dist/static/en-US-docs%2Fadvanced%2Fsubsequent-loads.html',
[2]   filename: '/home/user/perseus/website/.perseus/dist/static/en-US-docs%2Fadvanced%2Fsubsequent-loads.html'
[2] }
[2] bonnie site serve exited with code 1
^C
user@debian:~/perseus$ [0] bonnie site export exited with code SIGINT
[1] bonnie site build-tailwind exited with code SIGINT
^C^C
user@debian:~/perseus$ rustup target add wasm32-unknown-unknown
info: component 'rust-std' for target 'wasm32-unknown-unknown' is up to date
user@debian:~/perseus$ bonnie setup
   Compiling perseus-cli v0.3.0 (/home/user/perseus/packages/perseus-cli)
    Finished dev [unoptimized + debuginfo] target(s) in 2.73s

up to date, audited 132 packages in 681ms

17 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
node:assert:123
  throw new AssertionError(obj);
  ^

AssertionError [ERR_ASSERTION]: [concurrently] no commands provided
    at module.exports (/home/user/.nvm/versions/node/v16.13.1/lib/node_modules/concurrently/src/concurrently.js:26:12)
    at exports (/home/user/.nvm/versions/node/v16.13.1/lib/node_modules/concurrently/index.js:23:12)
    at Object.<anonymous> (/home/user/.nvm/versions/node/v16.13.1/lib/node_modules/concurrently/bin/concurrently.js:163:1)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:17:47 {
  generatedMessage: false,
  code: 'ERR_ASSERTION',
  actual: 0,
  expected: 0,
  operator: 'notStrictEqual'
}
^C
user@debian:~/perseus$ ^C^C
user@debian:~/perseus$ bonnie site
[0] entr: Unable to allocate memory for kernel queue. Please consult http://eradman.com/entrproject/limits.html
[0] bonnie site export exited with code 1
[2] [Browsersync] Access URLs:
[2]  ----------------------------------
[2]        Local: http://localhost:8080
[2]     External: http://10.0.0.10:8080
[2]  ----------------------------------
[2]           UI: http://localhost:3001
[2]  UI External: http://localhost:3001
[2]  ----------------------------------
[2] [Browsersync] Serving files from: .perseus/dist/exported
[2] [Browsersync] Watching files...
[1] 
[1] Rebuilding...
[1] Done in 433ms.
^C
user@debian:~/perseus$ [2] bonnie site serve exited with code SIGINT
[1] bonnie site build-tailwind exited with code SIGINT
^C^C
user@debian:~/perseus$ cat /proc/sys/fs/inotify/max_user_watches
8192

Also, I think all steps bellow (debian related) are prereqs to make the website run, but not documented at all.

rustup target add wasm32-unknown-unknown
cargo install wasm-pack
cargo install perseus-cli
sudo apt-get install entr

@arctic-hen7
Copy link
Member

I think you need to increase the file watcher limits on your system, which I did for mine a long time ago and now cannot remember how to do! A quick search will hopefully solve this.

Also, you're absolutely right on that other documentation since the changes to the way the website works after the size optimizations plugin was added.

@arctic-hen7
Copy link
Member

I think this might work.

@phaleth
Copy link
Contributor Author

phaleth commented Dec 30, 2021

I've increased the amount of file watcher limit, but the problem with concurrently still persists.

user@debian:~/perseus$ cat /proc/sys/fs/inotify/max_user_watches
524288

@arctic-hen7
Copy link
Member

Can you run the command defined in bonnie dev site manually? I wonder if it might be a shell issue...

@phaleth
Copy link
Contributor Author

phaleth commented Jan 2, 2022

Running the three commands of bonnie site separately works. Even with that I have ctrl+C out of the first two commands.

user@debian:~/perseus$ bonnie site export
  [1/2] 📦 Exporting your app's pages...✅
  [2/2] 🏗️  Building your app to Wasm...✅
bash returned exit code 0
^C
user@debian:~/perseus$ bonnie site build-tailwind

Rebuilding...
Done in 426ms.
^C
user@debian:~/perseus$ bonnie site serve
[Browsersync] Access URLs:
 ----------------------------------
       Local: http://localhost:8080
    External: http://10.0.0.10:8080
 ----------------------------------
          UI: http://localhost:3001
 UI External: http://localhost:3001
 ----------------------------------
[Browsersync] Serving files from: .perseus/dist/exported
[Browsersync] Watching files...

At least now I can see I have to fix the docs. Dockerfiles don't look like code.

image

@arctic-hen7
Copy link
Member

No problem, just fixed those in main after the merge.

@phaleth
Copy link
Contributor Author

phaleth commented Jan 2, 2022

Oh, me too, almost at the same minute, but differently

@phaleth
Copy link
Contributor Author

phaleth commented Jan 2, 2022

Btw, I think this PR is good to merge, but it's your call @arctic-hen7, heh.

As noted above, there are a few setup steps missing in the docs.

Copy link
Member

@arctic-hen7 arctic-hen7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, good to merge!

@arctic-hen7
Copy link
Member

Btw, in future, do you think you could sign your commits with GPG? Just makes things a little cleaner.

@arctic-hen7 arctic-hen7 merged commit 2b251be into framesurge:main Jan 2, 2022
@phaleth phaleth deleted the contrib-npm branch January 5, 2022 07:59
@phaleth
Copy link
Contributor Author

phaleth commented Jan 5, 2022

Ok, I'll try to keep that in mind for the next time. Thank you, @arctic-hen7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants