jeffdpho
jeffdpho
WWasp
Created by jeffdpho on 12/27/2024 in #đŸ™‹questions
strange behavior with not finding exports
hey, learning wasp and ran into this problem with finding imports in "wasp/client/operations". Sometimes it fixes itself with multiple wasp clean, wasp start, rm -rf .wasp, etc.. but wonder if anyone can explain why this happens and how to resolve it faster? I'm also using queries.js and actions.js as suggested in the 0.15.0 docs. This does make learning a bit slower so any help would be appreciated! using linux Debian 5.10.209-2, wasp 0.15.0, node v20.18.1, npm 10.8.2, react [email protected], react query @tanstack/[email protected] I get the following error: Project.jsx:9 Uncaught SyntaxError: The requested module '/@fs/data/ra-wasp/.wasp/out/sdk/wasp/dist/client/operations/index.js' does not provide an export named 'getUsers' (at Project.jsx:9:3) Here project.jsx imports, and operations/index.js, main.wasp. I have done a full clean/rebuilt/etc, browswer refresh, and still get same issue. What could be the issue. Reflect, and advise. Project.jsx
import {

useQuery,

useAction,

createProject,

getUsers

} from 'wasp/client/operations';
import {

useQuery,

useAction,

createProject,

getUsers

} from 'wasp/client/operations';
main.wasp:
query getUsers {

fn: import { getUsers } from "@src/queries.js",

entities: [User]

}
query getUsers {

fn: import { getUsers } from "@src/queries.js",

entities: [User]

}
index.js: cat .wasp/out/sdk/wasp/dist/client/operations/queries/index.js
import { createQuery } from './core';

// PUBLIC API

export const getUsers = createQuery('operations/get-users', ['User']);

export { buildAndRegisterQuery } from './core';
import { createQuery } from './core';

// PUBLIC API

export const getUsers = createQuery('operations/get-users', ['User']);

export { buildAndRegisterQuery } from './core';
I'm using vscode if I do this multiple times, sometimes I can refresh and it works
rm -rf .wasp
rm -rf node_modules
rm package-lock.json
wasp clean
npm install
wasp db migrate-dev
wasp db seed
wasp start
rm -rf .wasp
rm -rf node_modules
rm package-lock.json
wasp clean
npm install
wasp db migrate-dev
wasp db seed
wasp start
Thanks! Jeff
16 replies