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

Stop build with unsupported filenames #2609

Open
KidSysco opened this issue Apr 11, 2024 · 1 comment
Open

Stop build with unsupported filenames #2609

KidSysco opened this issue Apr 11, 2024 · 1 comment

Comments

@KidSysco
Copy link

KidSysco commented Apr 11, 2024

Environment

Not needed.

Reproduction

Not needed.

Describe the bug

When there are .ts files in the content folder, we get a warning message in the Build console output from line 47 of content/src/runtime/transformers/index.ts...

console.warn(`${ext} files are not supported, "${id}" falling back to raw content`)

Perhaps this should throw an error to stop the build and force it to break.

Otherwise, here is the scenario that played out today, and could break production builds for others too...

When developing in dev mode, there is no warning about putting .ts files in the content folder. Everything just works perfectly. There are also no docs about keeping .ts files in the content folder.

When doing a build there is no error, only this one warning (from line 47) that is embedded within thousands of lines of build output, and the build does not fail.

CI or Devops thinks all is good. So they deploy the site to production where the website totally breaks because it cannot find the code it needs.

Additional context

If we don't stop the build when things are not correct, then it can lead to broken websites getting deployed to production. We should also add to the docs about unsupported file extensions in the content folder.

Logs

Not needed.
@KidSysco
Copy link
Author

Why did I have .ts files in the content folder?

Because we are implementing I18n, which calls for language files. While these files are TS, they look, and feel a lot like typical content files. So we figured the content folder was a really good fit. It worked perfectly in dev, broke badly in production.

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

No branches or pull requests

1 participant