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

Invalid resource URL #20968

Closed
1 of 15 tasks
janousek opened this issue May 27, 2021 · 6 comments
Closed
1 of 15 tasks

Invalid resource URL #20968

janousek opened this issue May 27, 2021 · 6 comments
Labels
devkit/build-angular:i18n freq1: low Only reported by a handful of users who observe it rarely severity5: regression type: bug/fix

Comments

@janousek
Copy link

🐞 Bug report

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • extract-i18n
  • run
  • config
  • help
  • version
  • doc

Is this a regression?

Yes.

Description

Resource URL generated by WebpackResourceLoader is invalid. It is caused by this line:

const entry = data ? `angular-resource:${resourceType},${hash}` : filePath;

It should looks like this:

const entry = data ? `angular-resource://${resourceType},${hash}` : filePath; 

This is regression caused by this change:
8e741e1#diff-8f746eb1f9444d4c0e52eea0175d6a080fd8f7c38b8c8056e5abba89de3337c4

For me, this bug currently causes this error during i18n extraction:

angular-resource:style,13704965354860b52a891d7d35de9bb3:1:0 - Error: Module parse failed: Unexpected token (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders

@alan-agius4 alan-agius4 added area: @ngtools/webpack freq1: low Only reported by a handful of users who observe it rarely severity5: regression type: bug/fix labels May 27, 2021
@ngbot ngbot bot added this to the Backlog milestone May 27, 2021
@clydin
Copy link
Member

clydin commented May 27, 2021

That's a valid URI. A data URI, for instance, is of the form data:[<mediatype>][;base64],<data> (no slashes).

The error there is caused by the content failing to parse.

@janousek
Copy link
Author

@clydin If this is correct URI, then the bug is here:


Because it requires slashes.

@clydin
Copy link
Member

clydin commented May 27, 2021

Yes. that should be corrected. However, that would only affect i18n extraction and not a build.

@clydin
Copy link
Member

clydin commented May 27, 2021

As a temporary workaround, you can use 12.0.0 to extract and then re-upgrade to the latest until the next patch release.

@alan-agius4
Copy link
Collaborator

Closed via #20971

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jul 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
devkit/build-angular:i18n freq1: low Only reported by a handful of users who observe it rarely severity5: regression type: bug/fix
Projects
None yet
Development

No branches or pull requests

3 participants