nuxt-session
nuxt-session copied to clipboard
Unexpected character '�' after upgrade
Environment
- Operating System:
Windows_NT
- Node Version:
v16.15.0
- Nuxt Version:
3.0.0-rc.13
- Nitro Version:
0.6.1
- Package Manager:
[email protected]
- Builder:
vite
- User Config:
app
,build
,googleFonts
,modules
,session
,image
,routeRules
,runtimeConfig
,strapi
- Runtime Modules:
@sidebase/[email protected]
,@nuxtjs/[email protected]
,@nuxtjs/[email protected]
,@nuxt/[email protected]
,@vueuse/[email protected]
,[email protected]
,@nuxtjs/[email protected]
,@pinia/[email protected]
- Build Modules:
-
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.js#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
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: https://github.com/nuxt/nuxt.js/issues/15057 (very good link, thanks @blumgart)
Encountering the same issue. Resolved once the package was removed.
@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