Briefly summarize the issues you have been experiencing.
I’m trying to publish a staging version of my gatsby site to netlify. Everything is building fine on my computer, but when I run my build in netlify I get errors where all of my absolute imports cannot be seen, such as “Error: ./src/views/api/style.ts
Module not found: Error: Can’t resolve ‘./section/index’ in ‘/opt/build/repo/s rc/views/api’
resolve ‘./section/index’ in ‘/opt/build/repo/src/views/api’”
all of my file names are lowercase, it seems to have trouble recognizing my absolute imports and commonjs style imports from index.ts files
any guidance you could provide would be appreciated
What have you tried as far as troubleshooting goes? Do you have an idea what is causing the problem?
I’ve tried debugging Gatsby issues such as changing settings for the root import plugins, changing the names of all the files in my projects, and messing w the build settings. Nothing works.
Do you have any other information that is relevant, such as links to docs, libraries, or other resources?
I’m using Gatsby.js, and everything is working locally, can’t figure out what’s going on.
Here’s my total printout of the errors in the terminal:
2:54:45 PM: Error: ./src/views/api/style.ts
2:54:45 PM: Module not found: Error: Can’t resolve ‘./section/index’ in ‘/opt/build/repo/s rc/views/api’
2:54:45 PM: resolve ‘./section/index’ in ‘/opt/build/repo/src/views/api’
2:54:45 PM: using description file: /opt/build/repo/package.json (relative path: ./src/v iews/api)
2:54:45 PM: Field ‘browser’ doesn’t contain a valid alias configuration
2:54:45 PM: using description file: /opt/build/repo/package.json (relative path: ./src /views/api/section/index)
2:54:45 PM: no extension
2:54:45 PM: Field ‘browser’ doesn’t contain a valid alias configuration
2:54:45 PM: /opt/build/repo/src/views/api/section/index doesn’t exist
2:54:45 PM: .mjs
2:54:45 PM: Field ‘browser’ doesn’t contain a valid alias configuration
2:54:45 PM: /opt/build/repo/src/views/api/section/index.mjs doesn’t exist
2:54:45 PM: .js
2:54:45 PM: Field ‘browser’ doesn’t contain a valid alias configuration
2:54:45 PM: /opt/build/repo/src/views/api/section/index.js doesn’t exist
2:54:45 PM: .jsx
2:54:45 PM: Field ‘browser’ doesn’t contain a valid alias configuration
2:54:45 PM: /opt/build/repo/src/views/api/section/index.jsx doesn’t exist
2:54:45 PM: .wasm
2:54:45 PM: Field ‘browser’ doesn’t contain a valid alias configuration
2:54:45 PM: /opt/build/repo/src/views/api/section/index.wasm doesn’t exist
2:54:45 PM: .json
2:54:45 PM: Field ‘browser’ doesn’t contain a valid alias configuration
2:54:45 PM: /opt/build/repo/src/views/api/section/index.json doesn’t exist
2:54:45 PM: .ts
2:54:45 PM: Field ‘browser’ doesn’t contain a valid alias configuration
2:54:45 PM: /opt/build/repo/src/views/api/section/index.ts doesn’t exist
2:54:45 PM: .tsx
2:54:45 PM: Field ‘browser’ doesn’t contain a valid alias configuration
2:54:45 PM: /opt/build/repo/src/views/api/section/index.tsx doesn’t exist
2:54:45 PM: as directory
2:54:45 PM: /opt/build/repo/src/views/api/section/index doesn’t exist
2:54:45 PM: [/opt/build/repo/src/views/api/section/index]
2:54:45 PM: [/opt/build/repo/src/views/api/section/index.mjs]
2:54:45 PM: [/opt/build/repo/src/views/api/section/index.js]
2:54:45 PM: [/opt/build/repo/src/views/api/section/index.jsx]
2:54:45 PM: [/opt/build/repo/src/views/api/section/index.wasm]
2:54:45 PM: [/opt/build/repo/src/views/api/section/index.json]
2:54:45 PM: [/opt/build/repo/src/views/api/section/index.ts]
2:54:45 PM: [/opt/build/repo/src/views/api/section/index.tsx]
2:54:45 PM: @ ./src/views/api/style.ts 15:0-38 31:34-41
2:54:45 PM: @ ./src/views/api/index.tsx
2:54:45 PM: @ ./src/pages/api/index.tsx
2:54:45 PM: @ ./.cache/async-requires.js
2:54:45 PM: @ ./.cache/production-app.js
Hoping to hear how the experiments I coached you in in the helpdesk turned out? I see some successful builds on that site so I guess you did find a resolution yesterday, but of course happy to keep guiding you in debugging if I guessed wrong.
@akarsh is your repo public? if so, please provide a link to it. Also provide a link to one of your failing builds. Lastly, is the npm install and build working normally on your local machine?
Hi
Our main repo is private so i can’t get you a link for that, but this repo uses another repo as a package which is public (https://github.com/mokko-labs/sqrl-design-system) and also the source of the problem.
Link for failing build: https://app.netlify.com/sites/youthful-beaver-e12d80/deploys/5d48a404da4a1b9e227f2eaf
The site uses Gatsby. npm install, gatsby develop and gatsby build work perfectly on local.