CORS issue with Vimeo in Flutter (Access to XMLHttpRequest has been blocked by CORS policy)

Hi @titusrk, @luke, @hillary, @hrishikesh! I’m sorry that bothers you, but now my whole website is not working!

It is giving me an error:

Uncaught SyntaxError: Unexpected token <

I read this subject

I think this is the subject of my problem but I didn’t get a clear answer from it.
Do you know what I suppose to do and why is it not working? You already know my situation, what I did, again I just add the function, the js file, and now the website is not working. Can you please help me? Can you please give me a clear answer?

Here is my deployment console:

11:16:15 AM: Build ready to start
11:16:24 AM: build-image version: d2c6dbeac570350a387d832f64bc980dc964ad65 (focal)
11:16:24 AM: build-image tag: v4.8.0
11:16:24 AM: buildbot version: e58b6be665675c0f99b33132a8c1eec1f775eba1
11:16:24 AM: Fetching cached dependencies
11:16:24 AM: Starting to download cache of 784.5MB
11:16:33 AM: Finished downloading cache in 9.475549057s
11:16:33 AM: Starting to extract cache
11:16:43 AM: Finished extracting cache in 9.571142299s
11:16:43 AM: Finished fetching cache in 19.117683835s
11:16:43 AM: Starting to prepare the repo for build
11:16:43 AM: Preparing Git Reference refs/heads/test
11:17:04 AM: Parsing package.json dependencies
11:17:05 AM: Different publish path detected, going to use the one specified in the Netlify configuration file: 'MyCtoFriend_App/build/web' versus 'build/web' in the Netlify UI
11:17:05 AM: Different functions path detected, going to use the one specified in the Netlify configuration file: 'MyCtoFriend_App/build/web/functions' versus 'build/web/functions' in the Netlify UI
11:17:06 AM: Starting build script
11:17:06 AM: Installing dependencies
11:17:06 AM: Python version set to 2.7
11:17:06 AM: Started restoring cached node version
11:17:07 AM: Finished restoring cached node version
11:17:07 AM: v16.14.2 is already installed.
11:17:08 AM: Now using node v16.14.2 (npm v8.5.0)
11:17:08 AM: Started restoring cached build plugins
11:17:08 AM: Finished restoring cached build plugins
11:17:08 AM: Attempting ruby version 2.7.2, read from environment
11:17:09 AM: Using ruby version 2.7.2
11:17:09 AM: Using PHP version 8.0
11:17:09 AM: No npm workspaces detected
11:17:09 AM: Started restoring cached node modules
11:17:09 AM: Finished restoring cached node modules
11:17:10 AM: Started restoring cached go cache
11:17:10 AM: Finished restoring cached go cache
11:17:10 AM: go version go1.16.5 linux/amd64
11:17:10 AM: go version go1.16.5 linux/amd64
11:17:10 AM: Installing missing commands
11:17:10 AM: Verify run directory
11:17:11 AM: ​
11:17:11 AM: ────────────────────────────────────────────────────────────────
11:17:11 AM:   Netlify Build                                                 
11:17:11 AM: ────────────────────────────────────────────────────────────────
11:17:11 AM: ​
11:17:11 AM: ❯ Version
11:17:11 AM:   @netlify/build 27.0.1
11:17:11 AM: ​
11:17:11 AM: ❯ Flags
11:17:11 AM:   baseRelDir: true
11:17:11 AM:   buildId: 6262725fbc136b00081acc2d
11:17:11 AM: Creating deploy upload records
11:17:11 AM:   deployId: 6262725fbc136b00081acc2f
11:17:11 AM: ​
11:17:11 AM: ❯ Current directory
11:17:11 AM:   /opt/build/repo/MyCtoFriend_App
11:17:11 AM: ​
11:17:11 AM: ❯ Config file
11:17:11 AM:   No config file was defined: using default values.
11:17:11 AM: ​
11:17:11 AM: ❯ Context
11:17:11 AM:   production
11:17:11 AM: ​
11:17:11 AM: ────────────────────────────────────────────────────────────────
11:17:11 AM:   1. Functions bundling                                         
11:17:11 AM: ────────────────────────────────────────────────────────────────
11:17:11 AM: ​
11:17:11 AM: Packaging Functions from build/web/functions directory:
11:17:11 AM:  - getVimeo/getVimeo.js
11:17:11 AM: ​
11:17:12 AM: Starting post processing
11:17:11 AM: ​
11:17:11 AM: (Functions bundling completed in 220ms)
11:17:11 AM: ​
11:17:11 AM: ────────────────────────────────────────────────────────────────
11:17:11 AM:   2. Deploy site                                                
11:17:11 AM: ────────────────────────────────────────────────────────────────
11:17:11 AM: ​
11:17:11 AM: Starting to deploy site from 'MyCtoFriend_App/build/web'
11:17:11 AM: Creating deploy tree 
11:17:12 AM: 1 new files to upload
11:17:13 AM: Post processing - HTML
11:17:12 AM: 0 new functions to upload
11:17:12 AM: Site deploy was successfully initiated
11:17:12 AM: ​
11:17:12 AM: (Deploy site completed in 629ms)
11:17:13 AM: Post processing - header rules
11:17:12 AM: ​
11:17:12 AM: ────────────────────────────────────────────────────────────────
11:17:12 AM:   Netlify Build Complete                                        
11:17:12 AM: ────────────────────────────────────────────────────────────────
11:17:12 AM: ​
11:17:12 AM: (Netlify Build completed in 932ms)
11:17:12 AM: Caching artifacts
11:17:13 AM: Post processing - redirect rules
11:17:12 AM: Started saving node modules
11:17:12 AM: Finished saving node modules
11:17:12 AM: Started saving build plugins
11:17:12 AM: Finished saving build plugins
11:17:12 AM: Started saving pip cache
11:17:13 AM: Post processing done
11:17:12 AM: Finished saving pip cache
11:17:12 AM: Started saving emacs cask dependencies
11:17:12 AM: Finished saving emacs cask dependencies
11:17:12 AM: Started saving maven dependencies
11:17:12 AM: Finished saving maven dependencies
11:17:12 AM: Started saving boot dependencies
11:17:12 AM: Finished saving boot dependencies
11:17:12 AM: Started saving rust rustup cache
11:17:12 AM: Finished saving rust rustup cache
11:17:12 AM: Started saving go dependencies
11:17:12 AM: Finished saving go dependencies
11:17:12 AM: Build script success
11:17:17 AM: Site is live ✨
11:18:16 AM: Finished processing build request in 1m52.19845119s

I’m trying to add some headers related to the cache, but not sure what specifically I need, will gladly appreciate if you would be able to help me :slight_smile: