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

Fix: GA cors error #216

Merged
merged 5 commits into from
Mar 13, 2024
Merged

Fix: GA cors error #216

merged 5 commits into from
Mar 13, 2024

Conversation

flavioriper
Copy link
Contributor

@flavioriper flavioriper commented Mar 11, 2024

Changes

  • Changed the GA script to be pulled on each build to being hosted locally. This will fix the GA cors issue.

Tests / Screenshots

image

Lighthouse

image

Copy link

github-actions bot commented Mar 11, 2024

Visit the preview URL for this PR (updated for commit 92ab965):

https://estuary-marketing--pr216-fix-cors-errors-qr7nftnz.web.app

(expires Fri, 12 Apr 2024 17:36:44 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 76f6b095a0752e5d9c6c890267f9fdc3e392161e

static/gtag.js Outdated Show resolved Hide resolved
gatsby-config.ts Outdated Show resolved Hide resolved
@travjenkins
Copy link
Member

One issue with Partytown and GA is this break the testing tool : QwikDev/partytown#72

We should probably look into that a bit to see if there are any solutions/ideas/work arounds in that issue

@flavioriper flavioriper marked this pull request as ready for review March 13, 2024 12:11
@flavioriper flavioriper changed the title Fix: cors errors Fix: GA cors error Mar 13, 2024
@flavioriper flavioriper requested a review from travjenkins March 13, 2024 13:28
@travjenkins
Copy link
Member

Get an error in the console when starting up the app locally

...
 ERROR #11321  API.NODE.EXECUTION

"gatsby-node.js" threw an error while running the onPreBootstrap lifecycle:

fetch failed

  420 |
  421 | export const onPreBootstrap = async () => {
> 422 |     const response = await fetch('https://google-analytics.com/analytics.js');
      |           ^
  423 |     const buffer = Buffer.from(await response.arrayBuffer());
  424 |     await writeFile(path.join(__dirname, 'static', 'analytics.js'), buffer);
  425 | };

File: gatsby-node.ts:422:11



  TypeError: fetch failed
  
  - undici:11730 Object.fetch
    node:internal/deps/undici/undici:11730:11
  
  - task_queues:95 process.response
    node:internal/process/task_queues:95:5
  
  - gatsby-node.ts:422 Object.x
    /home/travis/code/marketing-site/gatsby-node.ts:422:11
  
  - api-runner-node.js:509 runAPI
    [marketing-site]/[gatsby]/src/utils/api-runner-node.js:509:16
  

success onPreBootstrap - 0.247s
success createSchemaCustomization - 1.223s
...

gatsby-node.ts Outdated Show resolved Hide resolved
@flavioriper
Copy link
Contributor Author

One issue with Partytown and GA is this break the testing tool : BuilderIO/partytown#72

We should probably look into that a bit to see if there are any solutions/ideas/work arounds in that issue

Since our GA script is completely down we can't check if it's happening to us, so I would suggest moving on to fix the problem we have now.

what do you think?

gatsby-node.ts Outdated Show resolved Hide resolved
Copy link
Member

@travjenkins travjenkins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some call outs and required changes

@travjenkins
Copy link
Member

One issue with Partytown and GA is this break the testing tool : BuilderIO/partytown#72
We should probably look into that a bit to see if there are any solutions/ideas/work arounds in that issue

Since our GA script is completely down we can't check if it's happening to us, so I would suggest moving on to fix the problem we have now.

what do you think?

This tool is to be used locally.... I do not think this is impacted by the prod issue.

@flavioriper
Copy link
Contributor Author

One issue with Partytown and GA is this break the testing tool : BuilderIO/partytown#72
We should probably look into that a bit to see if there are any solutions/ideas/work arounds in that issue

Since our GA script is completely down we can't check if it's happening to us, so I would suggest moving on to fix the problem we have now.
what do you think?

This tool is to be used locally.... I do not think this is impacted by the prod issue.

image

it's connecting here, so we probably fine

@flavioriper
Copy link
Contributor Author

Moved GA to be hosted statically within the project like before since it's something that barely changes over the year.

Copy link
Member

@travjenkins travjenkins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

We'll need some stuff built out to make this a proper solution as a fast follow.

Do not merge until a full build/test deploy is double checked.

@flavioriper
Copy link
Contributor Author

The build/test deployment is completed and healthy

can we go for the merge? @travjenkins

@travjenkins travjenkins merged commit 9b9f737 into master Mar 13, 2024
14 checks passed
@travjenkins travjenkins deleted the fix-cors-errors branch March 13, 2024 18:56
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 this pull request may close these issues.

2 participants