Skip to content

fix: don't force rewrite in preview mode #761

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

Merged
merged 5 commits into from
Nov 3, 2021
Merged

Conversation

ascorbic
Copy link
Contributor

@ascorbic ascorbic commented Nov 2, 2021

Summary

Currently we force a root level rewrite when in preview mode, so that we don't use ODBs or static HTML. This causes a bug where other static files are not found (e.g. images, css etc). This PR removes the force attribute. Because this would mean that statically-generated page files would then be served if using the EXPERIMENTAL_MOVE_STATIC_PAGES option, this also adds forced redirects for these.

Relevant links (GitHub issues, Notion docs, etc.) or a picture of cute animal (small picture)

image

Fixes #753

@github-actions github-actions bot added the type: bug code to address defects in shipped code label Nov 2, 2021
@ascorbic ascorbic requested a review from a team November 2, 2021 11:38
@ascorbic ascorbic self-assigned this Nov 2, 2021
tiffafoo
tiffafoo previously approved these changes Nov 2, 2021
Copy link

@tiffafoo tiffafoo left a comment

Choose a reason for hiding this comment

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

[sand] Another test to check that force is true would be good
[sand] Most likely this needs docs

Other than ^ LGTM! Could you include test steps? I've been publishing alpha versions and using them, but I'm guessing there's a better way.

@ascorbic
Copy link
Contributor Author

ascorbic commented Nov 3, 2021

@tiffanosaurus Thanks for the review!
Normally we can test most PRs using the plugin's demo site. Otherwise, pointing another site at the repo using package = "../path/to/netlify-plugin-nextjs" should do the trick
Re the docs, I'll try and cover this in the rewrites/redirects doc I'm working on
The test should be covered by the redirects snapshot test, though more specific tests are probably a good plan

Release-as: 4.0.0-beta.5
@kodiakhq kodiakhq bot merged commit c88a504 into main Nov 3, 2021
@kodiakhq kodiakhq bot deleted the fix/preview-redirects branch November 3, 2021 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge type: bug code to address defects in shipped code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Images in public files don't load while in preview mode
2 participants