I need advice to debug deploy Netlify App
Hi there, glad you found us before we can help you, we need a little more information on the issues you are facing.
Please tell us:
- what you are trying to achieve
- what you have already tried
- What the problem is, including any error messages you have received in your terminal window or in the developer console
- if the error is occurring in multiple browsers / machines, or just on one
Thank you! Looking forward to supporting you
Hi ,
In answer to your questions:
- what you are trying to achieve
I am trying to deploy a github create react app using the automatic building and deploying. Currently, i am building and deploying locally which works fine. - what you have already tried
I have tried setting environment variables because they are present locally like :
SASS_PATH=./node_modules;./src
but still no luck
- What the problem is, including any error messages you have received in your terminal window or in the developer console
this is the error:
Failed to compile.
4:31:35 PM:
4:31:35 PM: ./src/App.scss
4:31:35 PM: @import "@material/list/mdc-list";
4:31:35 PM: ^
4:31:35 PM: File to import not found or unreadable: @material/list/mdc-list.
4:31:35 PM: in /opt/build/repo/node_modules/@material/react-list/index.scss (line 23, column 1)
followed by
───────────────────────────────────────────────────────────────
4:31:35 PM: "build.command" failed
4:31:35 PM: ────────────────────────────────────────────────────────────────
4:31:35 PM:
4:31:35 PM: Error message
4:31:35 PM: Command failed with exit code 1: npm run build:staging
4:31:35 PM:
4:31:35 PM: Error location
4:31:35 PM: In Build command from Netlify app:
4:31:35 PM: npm run build:staging
4:31:35 PM:
4:31:35 PM: Resolved config
4:31:35 PM: build:
4:31:35 PM: command: npm run build:staging
4:31:35 PM: commandOrigin: ui
4:31:35 PM: environment:
4:31:35 PM: - REVIEW_ID
4:31:35 PM: - SASS_PATH
4:31:35 PM: publish: /opt/build/repo/build
4:31:35 PM: publishOrigin: ui
4:31:35 PM: functions:
4:31:35 PM: '*': {}
- if the error is occurring in multiple browsers / machines, or just on one
since this is a deployment problem, the error is just when i use automatic netlify deployment. works fine with a local npm run build ; netlify deploy
thanks,
any help appreciated!
1 Like
From what I read, the environment variable works differently on different Operating Systems. Thus, it might have worked locally, but not online.
What you could do is, instead is use a more general import method (~@material/list/mdc-list
) or set the variable like SASS_PATH=node_modules:src
. Reference here: Adding a Sass Stylesheet | Create React App
2 Likes
works now!
Thanks so much for the help
1 Like