denoland / fresh

The next-gen web framework.
https://fresh.deno.dev
MIT License
12.18k stars 623 forks source link

404 on loading plugin-twind-main.js #1678

Closed cknight closed 3 months ago

cknight commented 1 year ago

I've just upgraded to Fresh 1.4.2. When I build my project with deno task build and launch the site I now get a 404 from attempting to load plugin-twind-main.js.

http://localhost:8000/_frsh/js/62ccd15cffd2ab97bfc5746f8d22ba03af18915b/plugin-twind-main.js

This can be seen in Deploy as well by visiting, e.g., https://dev-tools.dev/base64-decode.

The HTML loaded contains the following:

<!DOCTYPE html>
<html>
    <head>
        <title>dev-tools</title>
        <meta charset="utf-8"/>
        <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
        <link rel="modulepreload" href="/_frsh/js/acf84d6ccb255abb4480e6a3b8270863025b62b6/plugin-twind-main.js"/>
        <link rel="modulepreload" href="/_frsh/js/acf84d6ccb255abb4480e6a3b8270863025b62b6/main.js"/>
        <link rel="modulepreload" href="/_frsh/js/acf84d6ccb255abb4480e6a3b8270863025b62b6/chunk-XZNBMHWY.js"/>

Other js files in _frsh load as expected. I've tried clearing and disabling the cache to no avail.

Code can be found in GitHub.

Locally there are no build errors or other messages. Unfortunately this 404 breaks my site as other javascript fails to load.

marvinhagemeister commented 1 year ago

Took a look and the build command is not aware of any plugins. Because of that no plugin-twind-main.js file will be generated. There is now a third parameter to dev() where this can be specified. Follow the "Migrating existing projects with Plugins" section in the docs to resolve this issue.

cknight commented 1 year ago

Thanks @marvinhagemeister, this did the trick. I did see that section in the docs but didn't click that the twind was a plugin (having been automatically added during project initialisation). That's my project back up and running. Thanks for the AOT build step by the way, it makes such a difference to my project and the instant load is such a joy!

marvinhagemeister commented 1 year ago

I'll reopen this issue because I feel like we could show a message in the console or something when this occurs.

marvinhagemeister commented 3 months ago

Closing as we're not officially supporting twind anymore. We have a guide on how to migrate from twind to tailwindcss here https://fresh.deno.dev/docs/examples/migrating-to-tailwind