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

font file extensions should be added to binaryExts in generateFiles #5213

Closed
erikagiroux opened this issue Apr 2, 2021 · 1 comment · Fixed by #6439
Closed

font file extensions should be added to binaryExts in generateFiles #5213

erikagiroux opened this issue Apr 2, 2021 · 1 comment · Fixed by #6439

Comments

@erikagiroux
Copy link
Contributor

Current Behavior

Binary files like font files can sometimes contain characters like <% and this can result in an error when running generateFiles because ejs tries to find a closing tag that does not exist. In my case, it happens with a .woff2 file but it could happen with other file types as well.

The error looks like this:

Error: Could not find matching close tag for "<%".

Expected Behavior

Binary files should not be rendered with ejs. I know image files have already been excluded. The same could be done with font files. The most common extensions for web fonts could be added to the list of binaryExts:

  • ttf
  • otf
  • woff
  • woff2
  • eot

It would be even better if we could identify binary formats automatically but since image extensions were added manually, it would make sense to include fonts too in order to cover the most common web assets.

Steps to Reproduce

  1. Create a new generator
  2. Create a new folder containing a font file that has <% somewhere it its content
  3. Use generateFiles to copy the folder containing the font file when running the generator
  4. The command will fail with this error
Error: Could not find matching close tag for "<%".

Environment

This is a blank workspace created by npx create-nx-plugin. It contains only a generator.

  Node : 14.15.2
  OS   : linux x64
  npm  : 6.14.9

  nx : Not Found
  @nrwl/angular : Not Found
  @nrwl/cli : 11.6.1
  @nrwl/cypress : Not Found
  @nrwl/devkit : 11.6.1
  @nrwl/eslint-plugin-nx : 11.6.1
  @nrwl/express : Not Found
  @nrwl/jest : 11.6.1
  @nrwl/linter : 11.6.1
  @nrwl/nest : Not Found
  @nrwl/next : Not Found
  @nrwl/node : 11.6.1
  @nrwl/react : Not Found
  @nrwl/schematics : Not Found
  @nrwl/tao : 11.6.1
  @nrwl/web : Not Found
  @nrwl/workspace : 11.6.1
  @nrwl/storybook : Not Found
  @nrwl/gatsby : Not Found
  typescript : 4.0.7
erikagiroux added a commit to erikagiroux/nx that referenced this issue Jul 20, 2021
Add font file extensions to the list of extensions that should not be rendered with ejs

ISSUES CLOSED: nrwl#5213
erikagiroux added a commit to erikagiroux/nx that referenced this issue Jul 20, 2021
Add font file extensions to the list of extensions that should not be rendered with ejs

ISSUES CLOSED: nrwl#5213
FrozenPandaz pushed a commit that referenced this issue Jul 29, 2021
….ts (#6439)

Add font file extensions to the list of extensions that should not be rendered with ejs

ISSUES CLOSED: #5213

Co-authored-by: egiroux <erika.giroux@ubisoft.com>
FrozenPandaz pushed a commit that referenced this issue Jul 29, 2021
….ts (#6439)

Add font file extensions to the list of extensions that should not be rendered with ejs

ISSUES CLOSED: #5213

Co-authored-by: egiroux <erika.giroux@ubisoft.com>
ManojBahuguna pushed a commit to ManojBahuguna/nx that referenced this issue Sep 16, 2021
….ts (nrwl#6439)

Add font file extensions to the list of extensions that should not be rendered with ejs

ISSUES CLOSED: nrwl#5213

Co-authored-by: egiroux <erika.giroux@ubisoft.com>
@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants