Kevin Grimm
06/04/2022, 4:38 AMnpx sst build
error with a Next/Tailwind starter blog for 3 nights worth of debugging and currently facing a TypeError
. I've been testing different packages, package versions, config files etc but haven't figured out how to crack this one yet
> Build error occurred
TypeError: Cannot read properties of undefined (reading '1')
at isFileType (node:fs:208:19)
at Object.readFileSync (node:fs:456:16)
at /path/to/files/frontend/.next/serverless/chunks/669.js:101784:19
at Array.map (<anonymous>)
at /path/to/files/frontend/.next/serverless/chunks/669.js:101783:30
at Object.35240 (/path/to/files/frontend/.next/serverless/chunks/669.js:101788:2)
at __webpack_require__ (/path/to/files/frontend/.next/serverless/webpack-runtime.js:25:43)
at Object.19625 (/path/to/files/frontend/.next/serverless/chunks/669.js:228937:18)
at __webpack_require__ (/path/to/files/frontend/.next/serverless/webpack-runtime.js:25:43)
at Object.90809 (/path/to/files/frontend/.next/serverless/chunks/332.js:229:28) {
type: 'TypeError'
}
What's odd is that npm run build
runs in the frontend
directory; it's just when trying to execute via sst
where there's an issue... at this point I still can't say for certain that this is an SST issue, but I've scoured multiple threads/questions/issues to no avail. I'm also inexperienced with webpack which is being used in the starter (https://github.com/timlrx/tailwind-nextjs-starter-blog)
Worst case scenario I am going to spin up a new Next frontend and incrementally add in pages/components while validating the build works via npx sst build
. I have a separate SST app that's working with a Next frontend though that one has far fewer bells and whistles (which I'm suspecting is a potential issue besides my lack of familiarity w/ compiling)Kevin Grimm
06/04/2022, 4:01 PMnpx sst deploy
is working. It remans beyond me what the issue with the former template was, though I suspect it was likely a dependency/package issue.Kevin Grimm
06/04/2022, 4:11 PMFrank
NextjsSite
construct uses the serverless-nextjs library for bundling.Frank
Frank
sst.NextjsSite
.Frank
Kevin Grimm
06/05/2022, 9:32 PMKevin Grimm
06/05/2022, 9:33 PM.md
files