kwicherbelliaken / bad-reviews-make-good-movies

0 stars 0 forks source link

[CHORE]: update astro and astro sst #56

Closed slackermorris closed 9 months ago

slackermorris commented 10 months ago
slackermorris commented 10 months ago

Here we go. Lol.

Screen Shot 2023-11-12 at 3 02 51 PM
slackermorris commented 10 months ago

I should really upgrade to Node 18.

Screen Shot 2023-11-12 at 3 04 09 PM
slackermorris commented 10 months ago

Big upgrades.

Screen Shot 2023-11-12 at 3 16 45 PM
slackermorris commented 10 months ago

Perhaps something else to be concerned about.

Screen Shot 2023-11-12 at 3 18 25 PM
slackermorris commented 10 months ago

I also updated sst:

Screen Shot 2023-11-13 at 8 32 19 AM
slackermorris commented 10 months ago
Screen Shot 2023-11-13 at 8 36 35 AM
slackermorris commented 10 months ago

Eeeep. Think we are going to have some difficulties here.

Screen Shot 2023-11-13 at 8 39 02 AM

It is probably a good idea to figure out the relevance of that vite plugin.

slackermorris commented 10 months ago

If I comment everything out on the page, then things start working again.

Screen Shot 2023-11-13 at 8 19 36 PM
slackermorris commented 10 months ago

I returned the StarMenu component and stripped it back to nothing and I still noticed the same errors. So, seems like something to do with React.

Screen Shot 2023-11-13 at 8 24 14 PM
slackermorris commented 10 months ago

Notice that the Header component does not cause the same error. The only difference is that it does not import React.

Screen Shot 2023-11-13 at 8 26 24 PM
slackermorris commented 10 months ago

OK. It has something to do with the client:load tag we pass the component.

slackermorris commented 10 months ago

This might be of some help.

slackermorris commented 9 months ago

I have been tasked with setting up a code space so that I can replicate the issue.

Screen Shot 2023-11-14 at 6 07 00 PM
slackermorris commented 9 months ago

I am going to try to nuke the project before trying to set up a code space.

slackermorris commented 9 months ago

I have noticed this error in the console.

Screen Shot 2023-11-15 at 8 06 31 AM

This might come in handy later on when I am attempting to solve for the above: https://github.com/Accudio/async-alpine/issues/27#issuecomment-1435703790

This offers a really handy explanation: https://stackoverflow.com/questions/69300341/typeerror-failed-to-fetch-dynamically-imported-module-on-vue-vite-vanilla-set

slackermorris commented 9 months ago

Network trace for my current broken branch feature/upgrade-astro-and-introduce-view-transitions.

Screen Shot 2023-11-15 at 8 17 46 AM
slackermorris commented 9 months ago

master network trace.

Screen Shot 2023-11-15 at 8 20 36 AM
slackermorris commented 9 months ago

I did a git bisect.

Screen Shot 2023-11-15 at 8 28 03 AM

Something has gone waaaaay skew whiff.

slackermorris commented 9 months ago

The only thing that seems culprit is this. Green being what I added to this, the broken commit.

Screen Shot 2023-11-16 at 7 58 42 AM
slackermorris commented 9 months ago

OK. Let's try again and see if we can upgrade the astro sst integration.

  1. Check out previous commit.
  2. Branch off this.
  3. Try to upgrade the astro sst integration.
slackermorris commented 9 months ago

This is what I am using to upgrade sst to v.2.35.0.

Screen Shot 2023-11-16 at 8 14 25 AM
slackermorris commented 9 months ago

Cool. Running that resulted in this:

Screen Shot 2023-11-16 at 8 17 05 AM
slackermorris commented 9 months ago

Alright. We are back to square one.

Screen Shot 2023-11-16 at 8 17 31 AM

I am going to try bumping a version higher. I wonder if 2.35.0 actually supports Astro 3.0?

slackermorris commented 9 months ago

This feels interesting: https://www.joshmedeski.com/posts/upgrading-to-astro-v3/

slackermorris commented 9 months ago

Lol. 2.36.1 works.

slackermorris commented 9 months ago

I am going to try replicate the issue using StackBlitz. I found an Astro template here.

slackermorris commented 9 months ago

Wait. What the fuck. 2.35.0 is now working on my local.

Screen Shot 2023-11-16 at 8 09 51 PM

I can't explain this at all.

slackermorris commented 9 months ago

OK scratch that I did a npm i and it has bonked again.

slackermorris commented 9 months ago

Here is my Stackblitz.

I can't seem to replicate my issue. Everything seems to be working fine.

I do know that this plugin is my issue.

slackermorris commented 9 months ago

This was my last Google: https://www.google.com/search?q=vitest+@vitejs/plugin-react+can't+detect+preamble.+something+is+wrong&oq=react+can't+detect+preamble+&sourceid=chrome&ie=UTF-8

slackermorris commented 9 months ago

I nuked the node_modules and the package-lock. I'll see what that does.

I can't get a replication in that StackBlitz sandbox. Maybe I try for a new project on my machine?

slackermorris commented 9 months ago

Looks like I got it to work.

![Uploading Screen Shot 2023-11-17 at 9.12.32 AM.png…]()

slackermorris commented 9 months ago

Screenshot for above.

Screen Shot 2023-11-17 at 9 13 20 AM
slackermorris commented 9 months ago

🔦 THIS WORKS

  1. "sst": "2.35.0", "astro-sst": "2.35.0" / "@astrojs/react": "^2.2.1" "astro": "^3.5.5".
{
  "dependencies": {
    "@astrojs/react": "^2.2.1",
    "astro": "^3.5.5"
  },
  "devDependencies": {
    "astro-sst": "2.35.0",
    "aws-cdk-lib": "2.101.1",
    "constructs": "10.2.69",
    "sst": "2.35.0"
  }
}
  1. "sst": "2.36.1", "astro-sst": "2.36.1" / "@astrojs/react": "^3.0.4" "astro": "^3.5.5".

This is curious because @astro/react 3.0.4 does not play nice with sst 2.35.0.

{
  "dependencies": {
    "@astrojs/react": "^3.0.4",
    "astro": "^3.5.5"
  },
  "devDependencies": {
    "astro-sst": "2.36.1",
    "aws-cdk-lib": "2.101.1",
    "constructs": "10.2.69",
    "sst": "2.36.1"
  }
}

DOES IT WORK IF I BUMP THE REACT INTEGRATION?

WHAT HAPPENS IF I BUMP THE SST INTEGRATION?

WHAT HAPPENS IF ASTRO IS BUMPED LOWER THAN 3.5.5?

slackermorris commented 9 months ago

🧧 THIS DOES NOT WORK

{
  "name": "bad-reviews-make-good-movies",
  "type": "module",
  "version": "0.0.1",
  "engines": {
    "node": ">=18.14.1"
  },
  "scripts": {
  },
  "dependencies": {
    "@astrojs/react": "^3.0.4",
    "astro": "^3.4.3",
  },
  "devDependencies": {
    "astro-sst": "2.35.0",
    "aws-cdk-lib": "2.101.1",
    "constructs": "10.2.69",
    "sst": "2.35.0",
  }
}
  1. "sst": "2.35.0", "astro-sst": "2.35.0" / "@astrojs/react": "^3.0.4" "astro": "^3.5.5".

It's the @astrojs/react integration which is causing the issue.

{
  "dependencies": {
    "@astrojs/react": "^3.0.4",                                 <----- THIS IS THE NOTICEABLE DIFFERENCE
    "astro": "^3.5.5"
  },
  "devDependencies": {
    "astro-sst": "2.35.0",
    "aws-cdk-lib": "2.101.1",
    "constructs": "10.2.69",
    "sst": "2.35.0"
  }
}
slackermorris commented 9 months ago

Basically prove that it is the @astrojs/react integration. Astro are the maintainers but the conflict is with sst so perhaps I should raise the issue to both of them.

slackermorris commented 9 months ago

Cool. Solution is to bump everything to its most recent version.

slackermorris commented 9 months ago

This PR took care of the @astrojs/react astro-sst issues.