Unexpected Characters when building

ERROR in ./resources/scripts/blueprint/extends/routers/routes.ts
Module build failed (from ./node_modules/babel-loader/lib/index.js):
SyntaxError: /var/www/pterodactyl/resources/scripts/blueprint/extends/routers/routes.ts: Unexpected character '�'. (3:72)

1 | import React from 'react';
2 |
> 3 | /* blueprint/import *//* SpaceinvadersImportStart */import Spaceinvaders�d���q��i� from '@/blueprint/extensions/spaceinvaders/sections/ExampleSection';/* SpaceinvadersImportEnd */
| ^
4 |
5 | interface RouteDefinition {
6 | path: string;
ERROR in ./resources/scripts/blueprint/extends/routers/routes.ts
Module build failed (from ./node_modules/babel-loader/lib/index.js):
SyntaxError: /var/www/pterodactyl/resources/scripts/blueprint/extends/routers/routes.ts: Unexpected character '�'. (3:72)

1 | import React from 'react';
2 |
> 3 | /* blueprint/import *//* SpaceinvadersImportStart */import Spaceinvaders�d���q��i� from '@/blueprint/extensions/spaceinvaders/sections/ExampleSection';/* SpaceinvadersImportEnd */
| ^
4 |
5 | interface RouteDefinition {
6 | path: string;
Fresh ptero install with only blueprint and nebula. No files modified. Used init to create a template for a component, didn't modify anything left everything default. Seems to be encoding all of the files with the name weirdly. All files show as UTF-8 when opened. Tried with a custom name as well, same issue Fresh install of ubuntu 22.04 NodeJS version v20.18.2 Very confused
18 Replies
Lara
Lara7mo ago
Do the files use standard character sets?, they might be utf-8 but if they don't use standard character sets that will most likely still cause issues Also it could be an issue with CRLF line endings from windows You could try to dos2unix that file it's unlikely since it's in the middle of a string but who knows
NoPantsMcDance | suhosting.net
It does that error for every single file blueprint modifies to build the component. Tried dos2unix, no luck VSCode shows the file as LF. I'm unsure how to check if they don't use standard character sets as that's something I've never modified or come across
0x7d8
0x7d87mo ago
whats the locale of your system
NoPantsMcDance | suhosting.net
root@node5:/var/www/pterodactyl# locale
LANG=en_US
LANGUAGE=en_US:
LC_CTYPE="en_US"
LC_NUMERIC="en_US"
LC_TIME="en_US"
LC_COLLATE="en_US"
LC_MONETARY="en_US"
LC_MESSAGES="en_US"
LC_PAPER="en_US"
LC_NAME="en_US"
LC_ADDRESS="en_US"
LC_TELEPHONE="en_US"
LC_MEASUREMENT="en_US"
LC_IDENTIFICATION="en_US"
LC_ALL=
root@node5:/var/www/pterodactyl# locale
LANG=en_US
LANGUAGE=en_US:
LC_CTYPE="en_US"
LC_NUMERIC="en_US"
LC_TIME="en_US"
LC_COLLATE="en_US"
LC_MONETARY="en_US"
LC_MESSAGES="en_US"
LC_PAPER="en_US"
LC_NAME="en_US"
LC_ADDRESS="en_US"
LC_TELEPHONE="en_US"
LC_MEASUREMENT="en_US"
LC_IDENTIFICATION="en_US"
LC_ALL=
root@node5:/var/www/pterodactyl# file -i /var/www/pterodactyl/resources/scripts/blueprint/extends/routers/routes.ts
/var/www/pterodactyl/resources/scripts/blueprint/extends/routers/routes.ts: text/x-java; charset=iso-8859-1
root@node5:/var/www/pterodactyl# file -i /var/www/pterodactyl/resources/scripts/blueprint/extends/routers/routes.ts
/var/www/pterodactyl/resources/scripts/blueprint/extends/routers/routes.ts: text/x-java; charset=iso-8859-1
That's interesting though
Lara
Lara7mo ago
You can use iconv to change it to utf-8 iconv -f ISO-8859-1 -t UTF-8 /var/www/pterodactyl/resources/scripts/blueprint/extends/routers/routes.ts > /var/www/pterodactyl/resources/scripts/blueprint/extends/routers/routes.ts Should be the command
NoPantsMcDance | suhosting.net
I'm thinknig the locale not being in en_US.UTF-8 is the problem. I attempted to switch it but it refuses to do so. One of my nodes correctly shows it as en_US.UTF-8 so I'm going to reinstall ptero over there real quick and see if that fixes it. I'm going to guess it will
0x7d8
0x7d87mo ago
yep its that
Lara
Lara7mo ago
The fact that your locale file doesn't explicitly specify UTF-8 is most likely the problem
NoPantsMcDance | suhosting.net
Yup that was it, ty for the help. Very strange I've never come across that before. My 4 22.04 servers locale are all en_US and my 2 24.04 servers are en_US.UTF-8. Attempted to change any of them to en_US.UTF-8 and it wouldn't let me. I don't have a base VM i can throw up to see if it's a 22.04 quirk or not. I'm going to guess the custom image my provider uses is just dumb and I've never come across any issues.
Lara
Lara7mo ago
You should be able to change that locale stuff using /etc/locale.conf hopefully Probably an issue with your provider, this is a Ubuntu 22.04 image as provided by hetzner
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
NoPantsMcDance | suhosting.net
That's what I figured was going on. No idea why they'd change that
Lara
Lara7mo ago
Correction on Ubuntu it'd be update-locale command or /etc/default/locale or dpkg-reconfigure locales
Emma
Emma7mo ago
GitHub
ISO-8859-6 locales generate unexpected characters for route variabl...
Issue discovered by @InfraCharm Current Behavior When the system's locale is set to a ISO-8859-6 locale and an extension utilizing the Components.yml routes API is installed, build errors will ...
Emma
Emma7mo ago
Issue (and steps to reproduce) have been discovered 2 days ago. Blueprint will in the future warn you when using these locales when installing extensions, and halt installing extensions that require UTF-8-dependent APIs.
Lara
Lara7mo ago
In this case the charset according to file is ISO-8859-1 I think it's just an issue with most non UTF-8 charsets
Emma
Emma7mo ago
I'll modify the issue title
Emma
Emma7mo ago
No description
NoPantsMcDance | suhosting.net
Didn't even occur to me to check the github issues :heaviersob: Glad to see you already have a solution in place for the future

Did you find this page helpful?