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

[bug] get 404 not found ~partytown/debug/partytown-sandbox-sw.html with simple angular bundle html file and express server #193

Closed
hiepxanh opened this issue May 29, 2022 · 12 comments

Comments

@hiepxanh
Copy link

hiepxanh commented May 29, 2022

Describe the bug
Hi, nice to meet you. I see your team's videos on twitter and it so amazing. The other framework tutorial is very good. But I want to try on html example to implement on my Angular app. I do it with basic html and express example but it just not work. and get error.

To Reproduce
Steps to reproduce the behavior:
the partytown folder was copied by script, I just copy it again to this public folder.

  1. clone https://github.com/hiepxanh/partytown-example
  2. npm install then node server-html.js => should work fine, but node server-angular.js
  3. open incognito: first load work
  4. f5 to reload. See error

Reproduction link
my stackblitz here but I have cors problem on stackbitz server https://stackblitz.com/github/hiepxanh/partytown-example?file=server.js

Expected behavior
it should not error

Partytown version
What version of Partytown you are using, e.g. 0.0.6

Screenshots
If applicable, add screenshots to help explain your problem.
image

const express = require('express')
var cors = require('cors')
var app = express()

app.use(cors())

const port = 3000

const myLogger = function (req, res, next) {
  console.log('logger:', req.originalUrl)
  next()
}

app.use(myLogger)

app.use(express.static('public'))

app.listen(port, () => {
  console.log(`Example app listening on port ${port}`)
})

image

Additional context
I read this but doesn't help

https://partytown.builder.io/distribution#builderiopartytownlib

Also this issue doesn't help too #107

@hiepxanh
Copy link
Author

hiepxanh commented May 29, 2022

ok I guest problem it self is angular, here is the partytown html version, it work great
image
but the angular version

  • the same partytown version
  • the same patytown insert code
  • run first time work correctly,
  • second time is error
  • so weird...
    image
    image

@hiepxanh
Copy link
Author

hiepxanh commented May 29, 2022

here is angular project if you interest https://github.com/hiepxanh/clover-error
here is the video that i record https://drive.google.com/file/d/1UBokM5xuRr44gftJ70Sft6WwnQTr_T1W/view?usp=sharing
the video cannot play directly, maybe you should download it
I wonder how should we fix the problem, I should create angular issue or partytown issue?

@hiepxanh hiepxanh changed the title [bug] get 404 not found ~partytown/debug/partytown-sandbox-sw.html with simple html and express server [bug] get 404 not found ~partytown/debug/partytown-sandbox-sw.html with simple angular bundle html file and express server May 29, 2022
@hiepxanh
Copy link
Author

please help me...

@hiepxanh
Copy link
Author

https://github.com/hiepxanh/angular-partytown I update the angular 14 version. just only patch partytown on html only. still fail

@nicksrandall
Copy link
Contributor

nicksrandall commented Jun 6, 2022

I'm seeing this issue with React version as well.

There is no html in the lib folder and therefore it does not get copied over to my apps public folder to be served.

Here are some docs I found that describe the issue: https://partytown.builder.io/distribution

@hiepxanh
Copy link
Author

@steve8708 @adamdbradley sir? can you take a look?

@mhevery
Copy link
Contributor

mhevery commented Jun 29, 2022

Hey @hiepxanh ,
Let me see if I understand:
1st request it works
2nd request on page refresh it 404s.

Do you see any additional errors?

@hiepxanh
Copy link
Author

I dont see anything else sir, first time I thought server false but it server correctly, just auto fail on second query

@hiepxanh
Copy link
Author

@mhevery do you have any suggestions? I can do anything like a test or debug, or something, I love this library very much. but I need your guidance. I will do anything you need sir

@mhevery
Copy link
Contributor

mhevery commented Jun 29, 2022

One thing you can help is to make sure that the reproduction application is as small as possible. That makes our life easier in pinpointing the issue. (We are a bit busy with relate project so it may take some time to get to this.)

@hiepxanh
Copy link
Author

Yes sir, I already pushed the built version of angular here.
image
https://github.com/hiepxanh/partytown-example
I think it may be the angular itself have some block on the service worker which fails on the second request. I will try to reproduce on Angular 14 today

@adamdbradley
Copy link
Contributor

Sorry but this issue seems related to Angular and copying files to the correct location, and not partytown itself. https://partytown.builder.io/angular

@QwikDev QwikDev locked as off-topic and limited conversation to collaborators Aug 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants