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

bug: 'Could not resolve "./headers"' #83

Closed
FlippingBinary opened this issue Oct 11, 2022 · 2 comments · Fixed by #84
Closed

bug: 'Could not resolve "./headers"' #83

FlippingBinary opened this issue Oct 11, 2022 · 2 comments · Fixed by #84

Comments

@FlippingBinary
Copy link
Contributor

Bug

This bug can be reproduced by attempting to build the new SK app in ./demo. It was introduced by 5a6a64f because it adds a new headers module without making adapt(...) copy it to the build directory.

Proposed solution

Copy all the files in ./files to the build directory:

builder.copy(files, tmp, {
	replace: {
		SERVER: `${relativePath}/index.js`,
		MANIFEST: './manifest.js',
		DEBUG: debug.toString()
	}
});

It would replace these two code blocks:

builder.copy(join(files, 'entry.js'), entry, {
replace: {
SERVER: `${relativePath}/index.js`,
MANIFEST: './manifest.js',
DEBUG: debug.toString()
}
});

builder.copy(join(files, 'api'), apiDir);

Benefits

The provided constants SERVER, MANIFEST, and DEBUG could be used in more than just entry.js.

Downside

This would take up more space in the build directory for files that aren't needed there.

FlippingBinary added a commit to FlippingBinary/svelte-adapter-azure-swa that referenced this issue Oct 13, 2022
This was referenced Oct 13, 2022
@FlippingBinary
Copy link
Contributor Author

As mentioned here, the api directory does still need to be copied separately.

builder.copy(join(files, 'api'), apiDir);

@geoffrich
Copy link
Owner

Merging #86 should prevent a bug like this from getting merged in the future, since we run the demo build as part of PR verification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants