I have created a scaffold with command blitz generate recipe. generated code has module import error for queries and mutation.

checklist-app $ blitz --version --verbose
You are using alpha software - if you have any problems, please open an issue here:
https://github.com/blitz-js/blitz/issues/new/choose
debug: global
debug: pkgPath: /usr/local/lib/node_modules/blitz/node_modules/@blitzjs/cli/lib/src/index.js
macOS Catalina | darwin-x64 | Node: v12.16.2
blitz: 0.8.1 (global)


Thanks for the issue! Could you try:
rm -rf .blitz
blitz start again
And see if that makes any difference?
you mean blitz start. i tried it and it outputs like.

i could solve this issue by importing it like

Hi @ganeshmani, thank you for submitting an issue.
@merelinguist Is this similar to https://github.com/blitz-js/blitz/issues/193? My comment in the aforementioned issue https://github.com/blitz-js/blitz/issues/193#issuecomment-623038968 seems similar, don't it? This might be a duplicate issue.
@simonpeterdebbarma Not sure about that, since @ganeshmani is using macOS.
@merelinguist Are the packages different for Mac and Windows?
Yes. From the looks of it, #193 is related to specific problems related to running child_process on Windows. This error looks more like a cross-platform issue.
When I use blitz generate all recipe it created these files:
CREATE app/recipes/pages/recipes/[id]/edit.tsx
CREATE app/recipes/pages/recipes/[id].tsx
CREATE app/recipes/pages/recipes/index.tsx
CREATE app/recipes/pages/recipes/new.tsx
CREATE app/recipes/queries/recipes/getRecipe.ts
CREATE app/recipes/queries/recipes/getRecipes.ts
CREATE app/recipes/mutations/recipes/createRecipe.ts
CREATE app/recipes/mutations/recipes/deleteRecipe.ts
CREATE app/recipes/mutations/recipes/updateRecipe.ts
that means that the import in your code is wrong. It should be:
import getRecipes from app/recipes/queries/recipes/getRecipes.ts
@gielcobben Got it. i think the scaffold missed the folder structure on import. when i change it, the error is gone.
CREATE app/recipes/pages/recipes/[id]/edit.tsx
CREATE app/recipes/pages/recipes/[id].tsx
CREATE app/recipes/pages/recipes/index.tsx
CREATE app/recipes/pages/recipes/new.tsx
CREATE app/recipes/queries/recipes/getRecipe.ts
CREATE app/recipes/queries/recipes/getRecipes.ts
CREATE app/recipes/mutations/recipes/createRecipe.ts
CREATE app/recipes/mutations/recipes/deleteRecipe.ts
CREATE app/recipes/mutations/recipes/updateRecipe.ts
@simonpeterdebbarma i would like to take up this issue if anybody is not working on it.
Sure, go ahead. Thank you very much!
Hey y'all! We are tracking this issue here: https://github.com/blitz-js/blitz/issues/402
Should have a hot fix soon.
This is fixed in blitz 0.8.2!
Most helpful comment
@gielcobben Got it. i think the scaffold missed the folder structure on import. when i change it, the error is gone.