Skip to content
This repository has been archived by the owner on Dec 12, 2023. It is now read-only.

Unexpected character '�' after upgrade #34

Open
blumgart opened this issue Nov 22, 2022 · 3 comments
Open

Unexpected character '�' after upgrade #34

blumgart opened this issue Nov 22, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@blumgart
Copy link
Contributor

Environment



Reproduction

No response

Describe the bug

After upgrade from 0.2.3 to 0.2.5 and trying yarn build i get this error:

MZ�♥♦���☺▼�� �!�☺L�!This program cannot be run in DOS mode.
     ^
�n'�R�n'�Richo'�PEd��sjc�" �U��e'�=R��a'�=R�f'�=R��F'�U�l'�o'��'�R��g'�R�n'�R
☻↔�☺↑☺↑�►�☺►☻♠♠@♥♦☻`☺►►►►►p�☻�☻¶�☻( ♥�☺�☻$♥0�☻pЅ☻8☺☻�☻\�☻@.text0�☺►�☺♦ `.rdata��☻��☺@@.datap▼�☻�☻@�.pdata$☻∟�☻@@_RDATA�►♥☻�☻@@.rsrc�☺ ♥☻�☻@@.reloc00�☻3�H��(H�%��☺3�H��(�������������H�♣�}☻H�☺H�H�H�������������H�H�♣♣z☻H��HE���������������@SH��0H�♣��☻H��H��t☻��H�♥H���P►E3�H�D$ E3�3�3��������������������������@SH�� H�♣+}☻H��H�☺��☺t
-y☻耙����������������H�☺�������������@SH�� H�Q@H��H��►r-H�I(H��H��►r↑L�A�H��'I+�H�A�H��▼wMI��蠈H�C8H�♣↓|☻H�C@�C(H�♥H�S↑H��t↑�{ u


 ERROR  Unexpected character '�' (Note that you need plugins to import files that are not JavaScript)

  at error (/E:/Projects/ns-project/node_modules/rollup/dist/es/shared/rollup.js:1858:30)
  at Module.error (/E:/Projects/ns-project/node_modules/rollup/dist/es/shared/rollup.js:12429:16)
  at Module.tryParse (/E:/Projects/ns-project/node_modules/rollup/dist/es/shared/rollup.js:12806:25)
  at Module.setSource (/E:/Projects/ns-project/node_modules/rollup/dist/es/shared/rollup.js:12711:24)
  at ModuleLoader.addModuleSource (/E:/Projects/ns-project/node_modules/rollup/dist/es/shared/rollup.js:21959:20)

Similar problem - nuxt/nuxt#15057

npm ls argon2

PS E:\Projects\ns-project> npm ls argon2
ns-project@ E:\Projects\ns-project
└─┬ @sidebase/[email protected]
  └── [email protected]

Additional context

No response

Logs

No response

@blumgart blumgart added the bug Something isn't working label Nov 22, 2022
@BracketJohn
Copy link
Contributor

BracketJohn commented Nov 22, 2022

Hey @blumgart, thanks for the issue!

pinging @Voltra who implemented this, care to have a look? -> interesting that somebody switched to bcrypt because of it here: nuxt/nuxt#15057 (very good link, thanks @blumgart)

@chexburger
Copy link

chexburger commented Dec 7, 2022

Encountering the same issue. Resolved once the package was removed.

@chexburger
Copy link

chexburger commented Dec 8, 2022

@BracketJohn Just confirmed Argon2 to be the issue preventing building.

import * as bcrypt from 'bcrypt';
. . .
export const hashIpAddress = (ip) => !ip ? Promise.resolve(void 0) : bcrypt.hashSync(ip);
export const ipAddressesMatch = (ip, ipHash) => !ip && !ipHash ? Promise.resolve(false) : bcrypt.compareSync(ip, ipHash);

That snippet does not use any salt rounds and defaults to 10. Replacing those respective lines from Argon2 to bcrypt fixes the problem with no build issues. I have not tested this properly yet as I do not use this feature so I have not opened a pull request on this.
https://github.com/sidebase/nuxt-session/blob/main/src/runtime/server/middleware/session/ipPinning.ts

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

No branches or pull requests

3 participants