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

fix: #883 Tab view src leading baseURL #885

Merged

Conversation

richardevcom
Copy link
Contributor

Fixed issue #883: Cannot find any path matching /_tailwind/, when using baseUrl: /dev/.
Additionally added conditional baseURL output, where if it matches / it prefixes empty string '', making final Tab view src always /dev/_tailwind/ (depending on nuxt.config.ts) or /_tailwind/.

🔗 Linked issue

Issue #883

❓ Type of change

  • [ x] 🐞 Bug fix (a non-breaking change that fixes an issue)

📚 Description

 Fixed issue #883: Cannot find any path matching /_tailwind/, when using baseUrl: '/dev/'.

This change is required to fix Tailwind Config Viewer embedded url by appending missing baseUrl setting (if set).

richardevcom and others added 2 commits July 30, 2024 02:45
Fixed issue nuxt-modules#883: Cannot find any path matching /_tailwind/, when using baseUrl: '/dev/'.
Cannot find any path matching '/_tailwind/'
I made a mistak in previous commit forcing default '/' baseURL in front of already existing trailing slash before default `/_tailwind/`.

This fix makes sure if baseURL is `/` it removes it and if it has something similar to `/dev/` it with return `/dev`, making final url `/dev/_tailwind/`.
Copy link

netlify bot commented Jul 30, 2024

Deploy Preview for nuxt-tailwindcss ready!

Name Link
🔨 Latest commit 6feef56
🔍 Latest deploy log https://app.netlify.com/sites/nuxt-tailwindcss/deploys/66abbf962ebedb0008b95b63
😎 Deploy Preview https://deploy-preview-885--nuxt-tailwindcss.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

what-the-diff bot commented Jul 30, 2024

PR Summary

  • Improvement on URL Handling
    The 'module.ts' file was worked on to enhance the way we handle URLs in our application. By importing the 'withoutTrailingSlash' function from the 'ufo' library, we can ensure that all URLs used in our application do not have any unwanted trailing slashes. This increases the accuracy and functionality of URLs within our application resulting in a better user experience.

  • Update in View Object Source Property
    The source ('src') property in the 'view' object has been refreshed to incorporate the 'withoutTrailingSlash' function. This means that our base URLs, as they are defined in our application's settings, will now be free from trailing slashes, making them more precise and reliable when being utilized. This leads to a more robust system and smoother navigation for our users.

@richardevcom richardevcom changed the title fix: #883 Cannot find any path matching /_tailwind/, when using baseUrl: '/dev/' fix: #883 Tab view src leading baseURL Jul 30, 2024
@nhh
Copy link

nhh commented Jul 31, 2024

I am using nuxt2 and experiencing a smiliar issue. My app tries to handle /_tailwind and loads nuxt instead of the tw viewer. Is this fix only for nuxt3?

@richardevcom
Copy link
Contributor Author

richardevcom commented Jul 31, 2024

I am using nuxt2 and experiencing a smiliar issue. My app tries to handle /_tailwind and loads nuxt instead of the tw viewer. Is this fix only for nuxt3?

Yes, I think so. As far as I know Nuxt 2 baseURL config differs from Nuxt 3. I'm not sure yet, how the module works on Nuxt 2, but I will try to test it on version 2 today.

Can you submit your reproduction of the issue in #883?

@nhh
Copy link

nhh commented Aug 1, 2024

@richardevcom Sorry, I think my issue is not directly related to this fix. I opened #886 Please dont mind my comment here :)

Copy link
Collaborator

@ineshbose ineshbose left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for raising this ❤️ - no way this was missed till this point!

@ineshbose ineshbose merged commit 1be5497 into nuxt-modules:main Aug 1, 2024
6 checks passed
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 this pull request may close these issues.

3 participants