sql-js / react-sqljs-demo

A demonstration showing how to use sql.js with create-react-app
https://react-sqljs-demo.ophir.dev/
MIT License
104 stars 33 forks source link

this example was broken #9

Closed babycannotsay closed 2 years ago

babycannotsay commented 2 years ago

yarn build and yarn start both throw error

babycannotsay commented 2 years ago
  1. Cannot find module 'react-scripts/package.json'
  2. Module not found: Error: Can't resolve 'crypto in sql-awsm.js
lovasoa commented 2 years ago

I cannot reproduce this issue.

/tmp 
❯ git clone git@github.com:sql-js/react-sqljs-demo.git
Cloning into 'react-sqljs-demo'...
remote: Enumerating objects: 94, done.
remote: Counting objects: 100% (94/94), done.
remote: Compressing objects: 100% (78/78), done.
remote: Total 94 (delta 42), reused 40 (delta 12), pack-reused 0
Receiving objects: 100% (94/94), 453.52 KiB | 1.81 MiB/s, done.
Resolving deltas: 100% (42/42), done.

/tmp took 2s 
❯ cd react-sqljs-demo/

react-sqljs-demo on  master is 📦 v1.0.0 via  v16.13.2 
❯ npm i
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated sane@4.1.0: some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added
npm WARN deprecated rollup-plugin-babel@4.4.0: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-babel.
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated querystring@0.2.1: The
npm WARN deprecated babel-eslint@10.1.0: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
npm WARN deprecated @hapi/topo@3.1.6: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/address@2.1.4: Moved to 'npm install @sideway/address'
npm WARN deprecated @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/joi@15.1.1: Switch to 'npm install joi'
npm WARN deprecated @hapi/bourne@1.3.2: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated querystring@0.2.0: The
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated core-js@2.6.12: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.

added 1921 packages, and audited 1922 packages in 56s

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

107 vulnerabilities (94 moderate, 11 high, 2 critical)

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.
npm notice 
npm notice New minor version of npm available! 8.1.2 -> 8.5.1
npm notice Changelog: https://github.com/npm/cli/releases/tag/v8.5.1
npm notice Run npm install -g npm@8.5.1 to update!
npm notice 

react-sqljs-demo on  master [!] is 📦 v1.0.0 via  v16.13.2 took 56s 
❯ npm run build

> react-sqljs-demo@1.0.0 build
> craco build

Creating an optimized production build...
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db

Why you should do it regularly:
https://github.com/browserslist/browserslist#browsers-data-updating
Compiled successfully.

File sizes after gzip:

  237.97 KB  build/static/js/2.bc8fac1e.chunk.js
  986 B      build/static/js/main.d33d8d33.chunk.js
  782 B      build/static/js/runtime-main.138d57da.js
  277 B      build/static/css/main.29f1f53d.chunk.css

The project was built assuming it is hosted at /.
You can control this with the homepage field in your package.json.

The build folder is ready to be deployed.
You may serve it with a static server:

  npm install -g serve
  serve -s build

Find out more about deployment here:

  https://cra.link/deployment

react-sqljs-demo on  master [!] is 📦 v1.0.0 via  v16.13.2 took 20s 
❯ ls -lah build/
total 1,2M
drwxrwxr-x. 3 olojkine olojkine  120 21 févr. 10:58 .
drwxrwxr-x. 7 olojkine olojkine  280 21 févr. 10:57 ..
-rw-rw-r--. 1 olojkine olojkine  941 21 févr. 10:58 asset-manifest.json
-rw-rw-r--. 1 olojkine olojkine 2,1K 21 févr. 10:58 index.html
-rw-rw-r--. 1 olojkine olojkine 1,2M 21 févr. 10:58 sql-wasm-5bb75ff49a85d6b67f21bb7c25ab1b64.wasm
drwxrwxr-x. 4 olojkine olojkine   80 21 févr. 10:58 static

The code here is continuously built and deployed by cloudflare.