Fix astro/app import (#7821)

* core -> core.js

* changeset

* test

---------

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
This commit is contained in:
ottomated 2023-08-01 16:34:22 -07:00 committed by GitHub
parent 2f06923764
commit c00b6f0c49
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 25 additions and 1 deletions

View file

@ -0,0 +1,5 @@
---
'astro': patch
---
Fixes an issue that prevents importing `'astro/app'`

View file

@ -12,7 +12,7 @@ import { consoleLogDestination } from '../logger/console.js';
import { error, type LogOptions } from '../logger/core.js';
import { prependForwardSlash, removeTrailingForwardSlash } from '../path.js';
import { RedirectSinglePageBuiltModule } from '../redirects/index.js';
import { isResponse } from '../render/core';
import { isResponse } from '../render/core.js';
import {
createEnvironment,
createRenderContext,

View file

@ -0,0 +1,13 @@
import { expect } from 'chai';
describe('Import astro/app', async () => {
it('Successfully imports astro/app', async () => {
try {
await import('astro/app');
expect(true).to.be.true;
} catch (err) {
expect.fail(undefined, undefined, `Importing astro/app should not throw an error: ${err}`);
}
});
});

View file

@ -2721,6 +2721,12 @@ importers:
specifier: ^10.15.1
version: 10.15.1
packages/astro/test/fixtures/import-app:
dependencies:
astro:
specifier: workspace:*
version: link:../../..
packages/astro/test/fixtures/import-ts-with-js:
dependencies:
astro: