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

Cannot deploy to Cloudflare Pages / __VUE_PROD_DEVTOOLS__ is not defined #10339

Closed
1 task
npenner opened this issue Mar 6, 2024 · 3 comments
Closed
1 task
Labels
needs repro Issue needs a reproduction

Comments

@npenner
Copy link

npenner commented Mar 6, 2024

Astro Info

Astro                    v4.4.12
Node                     v18.17.1
System                   macOS (arm64)
Package Manager          npm
Output                   server
Adapter                  @astrojs/cloudflare
Integrations             @astrojs/tailwind
                         @astrojs/vue

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

When i try to deploy my project to Cloudflare Pages following the docs the whole build runs fine but when it gets uploaded i get an error from a functionsWorker. Now this might be rather Cloudflare related because the build itself is running fine but i thought i can ask here since i am using the cloudflare adapter which other people use as well and my app is pretty basic.
I am using one .vue-Component inside the Astro project.

I am new to Cloudflare pages and this is my first time using server mode / SSR with Astro. This might be a problem of my understanding how this whole thing works.

This is my package.json

{
  "name": "xxx",
  "type": "module",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "dev": "astro dev",
    "build": "astro build",
    "preview": "astro preview",
    "astro": "astro",
    "info": "astro info"
  },
  "dependencies": {
    "@astrojs/cloudflare": "^9.1.0",
    "@astrojs/tailwind": "^5.1.0",
    "@astrojs/vue": "^4.0.8",
    "astro": "^4.4.12",
    "astro-heroicons": "^2.1.1",
    "sass": "^1.71.1",
    "tailwindcss": "^3.4.1"
  }
}

And my astro.config.mjs

import { defineConfig } from 'astro/config';
import tailwind from '@astrojs/tailwind';
import vue from '@astrojs/vue';
import cloudflare from "@astrojs/cloudflare";

// https://astro.build/config
export default defineConfig({
  output: 'server',
  adapter: cloudflare(),
  integrations: [tailwind(), vue()]
});

I already tried to add different versions of this to the astro config:

vite: {
    define: {
      __VUE_PROD_DEVTOOLS__ :'false',
    }
}
or
vite: {
    define: {
      __VUE_PROD_DEVTOOLS__ :false,
    }
}
or
vite: {
    define: {
      __VUE_PROD_DEVTOOLS__ : JSON.stringify(false),
    }
}

with no success.

This is the cloudflare build protocol:

2024-03-06T08:58:28.726095Z	From https://github.com/xxx
2024-03-06T08:58:28.726615Z	 * branch            65b26161ae35a82c36d50f58be192f6a09b3885f -> FETCH_HEAD
2024-03-06T08:58:28.726771Z	
2024-03-06T08:58:28.767065Z	HEAD is now at 65b2616 updated astro package to 4.4.12
2024-03-06T08:58:28.76764Z	
2024-03-06T08:58:28.861228Z	
2024-03-06T08:58:28.86171Z	Using v2 root directory strategy
2024-03-06T08:58:28.88921Z	Success: Finished cloning repository files
2024-03-06T08:58:29.552754Z	Detected the following tools from environment: npm@9.6.7, nodejs@18.17.1
2024-03-06T08:58:29.553491Z	Installing project dependencies: npm clean-install --progress=false
2024-03-06T08:58:38.361966Z	
2024-03-06T08:58:38.362204Z	added 550 packages, and audited 551 packages in 8s
2024-03-06T08:58:38.362412Z	
2024-03-06T08:58:38.362603Z	195 packages are looking for funding
2024-03-06T08:58:38.362767Z	  run `npm fund` for details
2024-03-06T08:58:38.363933Z	
2024-03-06T08:58:38.364109Z	found 0 vulnerabilities
2024-03-06T08:58:38.382356Z	Executing user command: npm run build
2024-03-06T08:58:38.980884Z	
2024-03-06T08:58:38.981175Z	> @example/minimal@0.0.1 build
2024-03-06T08:58:38.981339Z	> astro build
2024-03-06T08:58:38.981487Z	
2024-03-06T08:58:40.536147Z	08:58:40 [WARN] [@astrojs/cloudflare] The current configuration does not support image optimization. To allow your project to build with the original, unoptimized images, the image service has been automatically switched to the 'noop' option. See https://docs.astro.build/en/reference/configuration-reference/#imageservice
2024-03-06T08:58:40.652394Z	08:58:40 [build] output: "server"
2024-03-06T08:58:40.652718Z	08:58:40 [build] directory: /opt/buildhome/repo/dist/
2024-03-06T08:58:40.652911Z	08:58:40 [build] adapter: @astrojs/cloudflare
2024-03-06T08:58:40.653125Z	08:58:40 [build] Collecting build info...
2024-03-06T08:58:40.653646Z	08:58:40 [build] ✓ Completed in 153ms.
2024-03-06T08:58:40.655389Z	08:58:40 [build] Building server entrypoints...
2024-03-06T08:58:59.645459Z	08:58:59 [vite] �[32m✓ built in 18.95s�[39m
2024-03-06T08:58:59.645732Z	08:58:59 [build] ✓ Completed in 18.99s.
2024-03-06T08:58:59.64635Z	
2024-03-06T08:58:59.646529Z	 building client (vite) 
2024-03-06T08:58:59.654437Z	08:58:59 [vite] transforming...
2024-03-06T08:59:00.14826Z	08:59:00 [vite] �[32m✓�[39m 16 modules transformed.
2024-03-06T08:59:00.179433Z	08:59:00 [vite] rendering chunks...
2024-03-06T08:59:00.207124Z	08:59:00 [vite] computing gzip size...
2024-03-06T08:59:00.212289Z	08:59:00 [vite] �[2mdist/�[22m�[36m_astro/hoisted.3MZjh_vF.js                  �[39m�[1m�[2m 0.22 kB�[22m�[1m�[22m�[2m │ gzip:  0.16 kB�[22m
2024-03-06T08:59:00.212472Z	08:59:00 [vite] �[2mdist/�[22m�[36m_astro/client.JLMMBDNL.js                   �[39m�[1m�[2m 0.78 kB�[22m�[1m�[22m�[2m │ gzip:  0.51 kB�[22m
2024-03-06T08:59:00.212642Z	08:59:00 [vite] �[2mdist/�[22m�[36m_astro/helper.bEWynt9N.js                   �[39m�[1m�[2m 1.19 kB�[22m�[1m�[22m�[2m │ gzip:  0.55 kB�[22m
2024-03-06T08:59:00.212781Z	08:59:00 [vite] �[2mdist/�[22m�[36m_astro/hoisted.klRybzsm.js                  �[39m�[1m�[2m 1.42 kB�[22m�[1m�[22m�[2m │ gzip:  0.56 kB�[22m
2024-03-06T08:59:00.212965Z	08:59:00 [vite] �[2mdist/�[22m�[36m_astro/ChildList.iwknvA-W.js                �[39m�[1m�[2m 5.26 kB�[22m�[1m�[22m�[2m │ gzip:  2.24 kB�[22m
2024-03-06T08:59:00.213099Z	08:59:00 [vite] �[2mdist/�[22m�[36m_astro/runtime-dom.esm-bundler.qYSWVgeb.js  �[39m�[1m�[2m63.29 kB�[22m�[1m�[22m�[2m │ gzip: 25.13 kB�[22m
2024-03-06T08:59:00.213234Z	08:59:00 [vite] �[32m✓ built in 562ms�[39m
2024-03-06T08:59:00.234565Z	08:59:00 
2024-03-06T08:59:00.234778Z	 finalizing server assets 
2024-03-06T08:59:00.235022Z	
2024-03-06T08:59:00.2352Z	08:59:00 [build] Rearranging server assets...
2024-03-06T08:59:00.299113Z	08:59:00 [build] Server built in 19.80s
2024-03-06T08:59:00.299336Z	08:59:00 [build] Complete!
2024-03-06T08:59:00.376673Z	Finished
2024-03-06T08:59:00.377421Z	Found _worker.js in output directory. Uploading.
2024-03-06T08:59:01.578121Z	✨ Compiled Worker successfully
2024-03-06T08:59:01.634714Z	Found _routes.json in output directory. Uploading.
2024-03-06T08:59:01.657346Z	Validating asset output directory
2024-03-06T08:59:02.33086Z	Deploying your site to Cloudflare's global network...
2024-03-06T08:59:05.487259Z	Uploading... (18/18)
2024-03-06T08:59:05.488316Z	✨ Success! Uploaded 0 files (18 already uploaded) (0.37 sec)
2024-03-06T08:59:05.488519Z	
2024-03-06T08:59:05.824726Z	✨ Upload complete!
2024-03-06T08:59:07.675307Z	Success: Assets published!
2024-03-06T08:59:08.67218Z	Error: Failed to publish your Function. Got error: Uncaught ReferenceError: __VUE_PROD_DEVTOOLS__ is not defined
  at functionsWorker-0.21662718510522527.js:2657:29
  at functionsWorker-0.21662718510522527.js:41:39
  at functionsWorker-0.21662718510522527.js:3065:3
  at functionsWorker-0.21662718510522527.js:41:39
  at functionsWorker-0.21662718510522527.js:3256:3
  at functionsWorker-0.21662718510522527.js:41:39
  at functionsWorker-0.21662718510522527.js:3529:3
  at functionsWorker-0.21662718510522527.js:41:39
  at functionsWorker-0.21662718510522527.js:6059:1

Any help or hints much appreciated.

What's the expected result?

Expected result would be a successful build/deploy.

Link to Minimal Reproducible Example

...

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Mar 6, 2024
@ematipico ematipico added the needs repro Issue needs a reproduction label Mar 6, 2024
Copy link
Contributor

github-actions bot commented Mar 6, 2024

Hello @npenner. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with needs repro will be closed if they have no activity within 3 days.

@github-actions github-actions bot removed the needs triage Issue needs to be triaged label Mar 6, 2024
@ematipico
Copy link
Member

@npenner If you get no issues without adapter, I suggest you to file an issue in the cloudflare adapter repo

@npenner
Copy link
Author

npenner commented Mar 6, 2024

@ematipico Thanks. Will do. Wasn't aware of that repo. My bad.

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

No branches or pull requests

2 participants