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

some plugin assets not working on github codespaces #2412

Open
joelanman opened this issue Aug 20, 2024 · 1 comment
Open

some plugin assets not working on github codespaces #2412

joelanman opened this issue Aug 20, 2024 · 1 comment

Comments

@joelanman
Copy link
Contributor

Description of the issue

Not sure if this is the kit or Codespaces

If a plugin's name has special characters like @ and /, for example @x-govuk/govuk-prototype-components, the assets fail to load on GitHub Codespaces

Steps to reproduce the issue

  1. Install the kit on GitHub Codespaces and install a plugin with special chars in the name, for example
npm install @x-govuk/govuk-prototype-components
  1. Go to Templates and look at the templates, any images or js will fail to load

From investigation, req.path normally gives something like

/plugin-assets/%40x-govuk%2Fgovuk-prototype-components/govuk-prototype-kit/init.js

but on Codespaces it gives

/plugin-assets/@x-govuk%252Fgovuk-prototype-components/govuk-prototype-kit/init.js

Actual vs expected behaviour

Ideally these plugins would work on Codespaces too

@joelanman
Copy link
Contributor Author

I think part of this might be a codespaces issue, but another part is, these paths are hard to code - when you need to refer to an asset you need to use the encoded path (not init as that runs automatically, but other assets).

npm itself does not encode the @:

https://www.npmjs.com/package/@x-govuk/govuk-prototype-components

so we could just do this and it would work everywhere and be easier to type and read

plugin-assets/@x-govuk/govuk-prototype-components/govuk-prototype-kit/init.js

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