Next.js Discord

Discord Forum

Dependency errors when creating a webpack compiler in a route handler

Unanswered
Dwarf Crocodile posted this in #help-forum
Open in Discord
Dwarf CrocodileOP
I've majorly simplified my code to this and when I send a request to this endpoint, I get errors stating Critical dependency: require function is used in a way in which dependencies cannot be statically extracted and other similar ones such as Critical dependency: the request of a dependency is an expression and Module not found: Can't resolve '@swc/core/package.json'.

Not sure what the issue is, other packages seem to work fine in route handlers, and I'm not sure why webpack isnt able to resolve dependencies when used like this. Does anyone know what is causing this?

4 Replies

Hi @Dwarf Crocodile , sorry for disturbing you, but would you mind telling what theme you're using? looks good to me.
@averydelusionalperson Hi <@170718757143052288> , sorry for disturbing you, but would you mind telling what theme you're using? looks good to me.
Dwarf CrocodileOP
found it through a theo vid recently. its called Vesper, and I added a couple custom colors, and then the chalice icon theme for the file tree
oh yeah, noice, I remember using that theme, but forgot the name. Thanks 🫡
Dwarf CrocodileOP
Bump