-
Notifications
You must be signed in to change notification settings - Fork 35
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
The preview build does not work when deployed on subpath #245
Comments
(Note: No reproduction needed on this one since it was discussed in Discord prior) |
For reference: https://vite.dev/guide/build#public-base-path Currently there is await viteBuild({
...config,
base: '/',
// ...
}); I don't know is it possible to achieve it without explicit passing a |
Tested it with patch settings the |
I've got to take a look at how it's breaking. I'll have some time this afternoon to do that, have a lot of work work to take care of this morning. |
Well, it seems it's not possible to implement without explicitly passing a base to the vite and router. So the proposed solution would be to add Then in the |
Thanks for all this info. This is next on my list to tackle. |
jsx-email
@jsxp-email/cli
Version?:When you deploy a preview app onto a subpath such as
https://mydomain.com/emails/
it doesn't work.The links to assets in the
index.html
are absolute.So when you open
https://mydomain.com/emails/
the index.html is loaded, but it tries to download assets from the root/
instead of the subpath/emails
The assets link should be relative, or there should be a way to specify a
basePath
for the build.I don't know how to create a reproduction link for this, because to showcase it you need to basically deploy it somewhere.
You can reproduce it locally by following the steps:
email preview ./emails/templates --build-path /tmp/subpath/email-preview
npx http-server /tmp/subpath/
The preview would be broken.
Also, the need to provide an absolute path for the
--build-path
is counterintuitive, i spend half an hour to understand where it goes when you pass relative path like--build-path ./dist/emails
For us this is important, because im trying to deploy a preview from PRs to the github pages, and it is deployed to a subpath such as
https://owner.github.io/repo-name/pr-223/emails
and doesn't work when served from this PR.The text was updated successfully, but these errors were encountered: