Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

integrated with the @vue/apollo-composable while building have the "define is not defined" error #51

Closed
lymanlai opened this issue Jun 4, 2021 · 1 comment · Fixed by #242

Comments

@lymanlai
Copy link

lymanlai commented Jun 4, 2021

Describe the bug/issue

add the @vue/apollo-composable: https://v4.apollo.vuejs.org/guide-composable/setup.html

pnpm run build
cause the following error
ReferenceError: define is not defined
    at Object.<anonymous> (app/node_modules/.pnpm/registry.nlark.com/@vue/apollo-composable@4.0.0-alpha.12_a8f1dfa507b9f65e6b5e71908ade3ac8/node_modules/@vue/apollo-composable/dist/vue-apollo-composable.js:48:1)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Module.<anonymous> (/Users/lyman/Desktop/opsk/web-app/.vite-ssg-temp/main.js:35:24)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
 ERROR  Command failed with exit code 1.

I think it's the problem that while the vite-ssg try to use the /@vue/apollo-composable/dist/vue-apollo-composable.js file that it include the define symbol

can reproduce by clone this repo and pnpm build : https://github.com/lymanlai/vue-apollo-build-error

@userquin
Copy link
Member

userquin commented May 5, 2022

@lymanlai try updating to latest version and check #230

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants