Closed marijoo closed 3 months ago
I just found out the problem was webpack import aliases inside the import, so this wouldn’t work:
import { slug } from "@utils/slug";
while this does:
import { slug } from "../src/utils/slug";
Sorry for disturbing.
Preliminary Checks
Description
I have an utility function I outsourced into a singular file. I narrowed the functionality down to just returning the input string just to make sure it’s no problem in the function itself:
If I import and call this method during the
createPages()
hook the build will break, no matter what I do. Placing the function directly intogatsby-node.ts
works just fine.Reproduction Link
//
Steps to Reproduce
gatsby-node.ts
createPages()
Expected Result
I’d expect to be able to import a function from a file.
Actual Result
The build breaks. The error is always something like this:
Environment
Config Flags
No response