This repository was archived by the owner on Jan 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +2
-39
lines changed
packages/serverless-components/nextjs-component Expand file tree Collapse file tree 2 files changed +2
-39
lines changed Original file line number Diff line number Diff line change @@ -940,41 +940,6 @@ describe("Custom inputs", () => {
940940 } ) ;
941941 } ) ;
942942
943- describe . each `
944- cloudFrontInput | expectedErrorMessage
945- ${ { "some-invalid-page-route" : { ttl : 100 } } } | ${ 'Could not find next.js pages for "some-invalid-page-route"' }
946- ` (
947- "Invalid cloudfront inputs" ,
948- ( { cloudFrontInput, expectedErrorMessage } ) => {
949- const fixturePath = path . join ( __dirname , "./fixtures/generic-fixture" ) ;
950- let tmpCwd : string ;
951-
952- beforeEach ( ( ) => {
953- tmpCwd = process . cwd ( ) ;
954- process . chdir ( fixturePath ) ;
955-
956- mockServerlessComponentDependencies ( { expectedDomain : undefined } ) ;
957- } ) ;
958-
959- afterEach ( ( ) => {
960- process . chdir ( tmpCwd ) ;
961- return cleanupFixtureDirectory ( fixturePath ) ;
962- } ) ;
963-
964- it ( "throws the correct error" , async ( ) => {
965- expect . assertions ( 1 ) ;
966-
967- try {
968- await createNextComponent ( ) . default ( {
969- cloudfront : cloudFrontInput
970- } ) ;
971- } catch ( err ) {
972- expect ( err . message ) . toContain ( expectedErrorMessage ) ;
973- }
974- } ) ;
975- }
976- ) ;
977-
978943 describe . each `
979944 cloudFrontInput | pathName
980945 ${ { api : { minTTL : 100 , maxTTL : 100 , defaultTTL : 100 } } } | ${ "api" }
Original file line number Diff line number Diff line change @@ -163,10 +163,8 @@ class NextjsComponent extends Component {
163163 }
164164
165165 if ( stillToMatch . size > 0 ) {
166- throw Error (
167- `CloudFront input failed validation. Could not find next.js pages for "${ [
168- ...stillToMatch
169- ] } "`
166+ this . context . debug (
167+ "There are other CloudFront path inputs that are not next.js pages, which will be added as custom behaviors."
170168 ) ;
171169 }
172170 }
You can’t perform that action at this time.
0 commit comments