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

Ensure next/image loads correctly with basePath #20592

Merged
merged 2 commits into from
Dec 30, 2020

Conversation

ijjk
Copy link
Member

@ijjk ijjk commented Dec 30, 2020

This ensures the default path used for the next/image component includes the basePath when configured. Additional tests have also been added to ensure the image component is working correctly with basePath configured.

Fixes: #19711

@vercel vercel bot temporarily deployed to Preview December 30, 2020 01:19 Inactive
@ijjk
Copy link
Member Author

ijjk commented Dec 30, 2020

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary ijjk/next.js image-basepath Change
buildDuration 11.1s 11.8s ⚠️ +643ms
nodeModulesSize 83 MB 83 MB ⚠️ +425 B
Page Load Tests Overall increase ✓
vercel/next.js canary ijjk/next.js image-basepath Change
/ failed reqs 0 0
/ total time (seconds) 2.22 2.237 ⚠️ +0.02
/ avg req/sec 1126.17 1117.69 ⚠️ -8.48
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.53 1.413 -0.12
/error-in-render avg req/sec 1634.17 1769.57 +135.4
Client Bundles (main, webpack, commons)
vercel/next.js canary ijjk/next.js image-basepath Change
677f882d2ed8..45a8.js gzip 12.7 kB 12.7 kB
framework.HASH.js gzip 39 kB 39 kB
main-eda9847..6ba4.js gzip 6.56 kB 6.56 kB
webpack-7193..1446.js gzip 751 B 751 B
Overall change 59 kB 59 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js image-basepath Change
polyfills-67..b7d1.js gzip 31.2 kB 31.2 kB
Overall change 31.2 kB 31.2 kB
Client Pages
vercel/next.js canary ijjk/next.js image-basepath Change
_app-6220e08..9a40.js gzip 1.28 kB 1.28 kB
_error-4b0b5..2c91.js gzip 3.44 kB 3.44 kB
hooks-5f309a..7282.js gzip 887 B 887 B
index-57f580..c562.js gzip 227 B 227 B
link-634b837..baee.js gzip 1.61 kB 1.61 kB
routerDirect..bd82.js gzip 303 B 303 B
withRouter-2..e384.js gzip 302 B 302 B
Overall change 8.05 kB 8.05 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js image-basepath Change
_buildManifest.js gzip 322 B 322 B
Overall change 322 B 322 B
Rendered Page Sizes
vercel/next.js canary ijjk/next.js image-basepath Change
index.html gzip 616 B 616 B
link.html gzip 621 B 621 B
withRouter.html gzip 608 B 608 B
Overall change 1.84 kB 1.84 kB

Serverless Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary ijjk/next.js image-basepath Change
buildDuration 13.1s 12.9s -148ms
nodeModulesSize 78.3 MB 83 MB ⚠️ +4.68 MB
Client Bundles (main, webpack, commons)
vercel/next.js canary ijjk/next.js image-basepath Change
677f882d2ed8..45a8.js gzip 12.7 kB 12.7 kB
framework.HASH.js gzip 39 kB 39 kB
main-eda9847..6ba4.js gzip 6.56 kB 6.56 kB
webpack-7193..1446.js gzip 751 B 751 B
Overall change 59 kB 59 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js image-basepath Change
polyfills-67..b7d1.js gzip 31.2 kB 31.2 kB
Overall change 31.2 kB 31.2 kB
Client Pages
vercel/next.js canary ijjk/next.js image-basepath Change
_app-6220e08..9a40.js gzip 1.28 kB 1.28 kB
_error-4b0b5..2c91.js gzip 3.44 kB 3.44 kB
hooks-5f309a..7282.js gzip 887 B 887 B
index-57f580..c562.js gzip 227 B 227 B
link-634b837..baee.js gzip 1.61 kB 1.61 kB
routerDirect..bd82.js gzip 303 B 303 B
withRouter-2..e384.js gzip 302 B 302 B
Overall change 8.05 kB 8.05 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js image-basepath Change
_buildManifest.js gzip 322 B 322 B
Overall change 322 B 322 B
Serverless bundles
vercel/next.js canary ijjk/next.js image-basepath Change
_error.js 1 MB 1 MB
404.html 2.67 kB 2.67 kB
hooks.html 1.92 kB 1.92 kB
index.js 1 MB 1 MB
link.js 1.06 MB 1.06 MB
routerDirect.js 1.05 MB 1.05 MB
withRouter.js 1.05 MB 1.05 MB
Overall change 5.16 MB 5.16 MB
Commit: 29d88e9

@vercel vercel bot temporarily deployed to Preview December 30, 2020 01:36 Inactive
@ijjk
Copy link
Member Author

ijjk commented Dec 30, 2020

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General Overall increase ⚠️
vercel/next.js canary ijjk/next.js image-basepath Change
buildDuration 8.5s 8.5s -39ms
nodeModulesSize 83 MB 83 MB ⚠️ +425 B
Page Load Tests Overall increase ✓
vercel/next.js canary ijjk/next.js image-basepath Change
/ failed reqs 0 0
/ total time (seconds) 1.721 1.742 ⚠️ +0.02
/ avg req/sec 1452.85 1435.2 ⚠️ -17.65
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.099 1.081 -0.02
/error-in-render avg req/sec 2275.13 2311.88 +36.75
Client Bundles (main, webpack, commons)
vercel/next.js canary ijjk/next.js image-basepath Change
677f882d2ed8..45a8.js gzip 12.7 kB 12.7 kB
framework.HASH.js gzip 39 kB 39 kB
main-eda9847..6ba4.js gzip 6.56 kB 6.56 kB
webpack-7193..1446.js gzip 751 B 751 B
Overall change 59 kB 59 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js image-basepath Change
polyfills-67..b7d1.js gzip 31.2 kB 31.2 kB
Overall change 31.2 kB 31.2 kB
Client Pages
vercel/next.js canary ijjk/next.js image-basepath Change
_app-6220e08..9a40.js gzip 1.28 kB 1.28 kB
_error-4b0b5..2c91.js gzip 3.44 kB 3.44 kB
hooks-5f309a..7282.js gzip 887 B 887 B
index-57f580..c562.js gzip 227 B 227 B
link-634b837..baee.js gzip 1.61 kB 1.61 kB
routerDirect..bd82.js gzip 303 B 303 B
withRouter-2..e384.js gzip 302 B 302 B
Overall change 8.05 kB 8.05 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js image-basepath Change
_buildManifest.js gzip 322 B 322 B
Overall change 322 B 322 B
Rendered Page Sizes
vercel/next.js canary ijjk/next.js image-basepath Change
index.html gzip 616 B 616 B
link.html gzip 621 B 621 B
withRouter.html gzip 608 B 608 B
Overall change 1.84 kB 1.84 kB

Serverless Mode
General Overall increase ⚠️
vercel/next.js canary ijjk/next.js image-basepath Change
buildDuration 10.3s 10.5s ⚠️ +133ms
nodeModulesSize 83 MB 83 MB ⚠️ +425 B
Client Bundles (main, webpack, commons)
vercel/next.js canary ijjk/next.js image-basepath Change
677f882d2ed8..45a8.js gzip 12.7 kB 12.7 kB
framework.HASH.js gzip 39 kB 39 kB
main-eda9847..6ba4.js gzip 6.56 kB 6.56 kB
webpack-7193..1446.js gzip 751 B 751 B
Overall change 59 kB 59 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ijjk/next.js image-basepath Change
polyfills-67..b7d1.js gzip 31.2 kB 31.2 kB
Overall change 31.2 kB 31.2 kB
Client Pages
vercel/next.js canary ijjk/next.js image-basepath Change
_app-6220e08..9a40.js gzip 1.28 kB 1.28 kB
_error-4b0b5..2c91.js gzip 3.44 kB 3.44 kB
hooks-5f309a..7282.js gzip 887 B 887 B
index-57f580..c562.js gzip 227 B 227 B
link-634b837..baee.js gzip 1.61 kB 1.61 kB
routerDirect..bd82.js gzip 303 B 303 B
withRouter-2..e384.js gzip 302 B 302 B
Overall change 8.05 kB 8.05 kB
Client Build Manifests
vercel/next.js canary ijjk/next.js image-basepath Change
_buildManifest.js gzip 322 B 322 B
Overall change 322 B 322 B
Serverless bundles
vercel/next.js canary ijjk/next.js image-basepath Change
_error.js 1 MB 1 MB
404.html 2.67 kB 2.67 kB
hooks.html 1.92 kB 1.92 kB
index.js 1 MB 1 MB
link.js 1.06 MB 1.06 MB
routerDirect.js 1.05 MB 1.05 MB
withRouter.js 1.05 MB 1.05 MB
Overall change 5.16 MB 5.16 MB
Commit: e3118f9

@kodiakhq kodiakhq bot merged commit 9625357 into vercel:canary Dec 30, 2020
@Timer Timer deleted the image-basepath branch December 30, 2020 06:01
@vercel vercel locked as resolved and limited conversation to collaborators Jan 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

next/image component can't find image when using basePath
2 participants