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

Error in postbuild when using react-snap #556

Open
wsabrinal opened this issue Apr 15, 2022 · 0 comments
Open

Error in postbuild when using react-snap #556

wsabrinal opened this issue Apr 15, 2022 · 0 comments

Comments

@wsabrinal
Copy link

Bug Report

Current Behavior
I've created an app using create-react-app and everything was working fine, including the build. I've followed the steps to implement react-snap (installed using npm, modified index.js, and added the postbuild in package.json). When I build now, I get the following error:

> [email protected] postbuild
> react-snap

node:internal/modules/cjs/loader:361
      throw err;
      ^

Error: Cannot find module 'D:\project\node_modules\minimalcss\node_modules\csso\node_modules\css-tree\lib\index'. Please verify that the package.json has a valid "main" entry
    at tryPackage (node:internal/modules/cjs/loader:353:19)
    at Function.Module._findPath (node:internal/modules/cjs/loader:566:18)
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (D:\project\node_modules\minimalcss\node_modules\csso\lib\index.js:1:15)
    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) {
  code: 'MODULE_NOT_FOUND',
  path: 'D:\\project\\node_modules\\minimalcss\\node_modules\\csso\\node_modules\\css-tree\\package.json',
  requestPath: 'css-tree'
}

It could be that this is no bug at all and that I'm missing something, but I have no clue and couldn't find something similar online.

Steps to reproduce
I've just created a new react app (using create-react-app) and created some pages. The following dependencies have been added:

  "dependencies": {
    "@testing-library/jest-dom": "^5.16.3",
    "@testing-library/react": "^12.1.4",
    "@testing-library/user-event": "^13.5.0",
    "bootstrap": "^5.1.3",
    "leaflet": "^1.7.1",
    "react": "^17.0.2",
    "react-bootstrap": "^2.2.2",
    "react-dom": "^17.0.2",
    "react-helmet": "^6.1.0",
    "react-icons": "^4.3.1",
    "react-leaflet": "^3.2.5",
    "react-router-dom": "^6.2.2",
    "react-scripts": "5.0.0",
    "web-vitals": "^2.1.4"
  },

When I remove the line "postbuild": "react-snap" in package.json, I get no build error anymore.

Expected behavior/code
I would expect that it just builds. :)

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

No branches or pull requests

1 participant