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

Styles and scripts give 404 when deployed unless the default configuration is repeated (OSOE-877) #104

Open
Piedone opened this issue Jul 4, 2024 · 8 comments
Labels
bug Something isn't working

Comments

@Piedone
Copy link
Member

Piedone commented Jul 4, 2024

Supposedly, this is the default config for styles and scripts, so you shouldn't have to add it to your packages.json:

{
...
  "nodejsExtensions": {
    "styles": {
      "source": "Assets/Styles",
      "target": "wwwroot/css"
    },
    "scripts": {
      "source": "Assets/Scripts",
      "target": "wwwroot/js"
    }
  }
}

However, if you omit this, then the files will give a 404 when deployed (to an Azure Web App, if that matters). The files are properly built otherwise though, locally from VS they still work, as well as when built and run with the .NET CLI during UI testing in CI workflows.

Specifying these defaults shouldn't be necessary.

Jira issue

@Piedone Piedone added the bug Something isn't working label Jul 4, 2024
@github-actions github-actions bot changed the title Styles and scripts give 404 when deployed unless the default configuration is repeated Styles and scripts give 404 when deployed unless the default configuration is repeated (OSOE-877) Jul 4, 2024
@sarahelsaig
Copy link
Member

I'm not sure how to test this, but would deployment work even if you only provide this much?

{
...
  "nodejsExtensions": {
    "styles": { },
    "scripts": { }
  }
}

I'm certain that if the style/script build starts, then the config will correctly get the default values in get-config.js. So I get a sense that maybe the build only triggers if there is a config?

@Piedone
Copy link
Member Author

Piedone commented Jul 4, 2024

I've sent you a PM on how you can test it with one of our apps (I can't really test it right now) but perhaps you're on the right track.

@sarahelsaig
Copy link
Member

Where? I don't see it.

@Piedone
Copy link
Member Author

Piedone commented Jul 4, 2024

I'll give you a hint: it starts with "Teams" and ends with "".

@sarahelsaig
Copy link
Member

Yes, obviously that's where I first checked. I haven't gotten a PM in Teams from you in a long while

@Piedone
Copy link
Member Author

Piedone commented Jul 4, 2024

Just check the project channel :). Fair enough, not private, just more private than this here.

@sarahelsaig
Copy link
Member

Doesn't work, unfortunately. (I get error Invalid group: {}: source must be a string, target must be a string.) The defaults are only filled in if you completely omit the (styles, scripts) property in nodejsExtensions. It still may be because of what I wrote above, but I don't have an easy workaround to test with.

@Piedone
Copy link
Member Author

Piedone commented Jul 5, 2024

I see, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants