Open jw176 opened 3 months ago
I have the same problem.
We have the same issue
Ok, I got a dirty-but-functional workaround in case you guys @jw176 and @alexey-systemseed still have this issue (or anyone else until Raisely deploys an actual fix)
NOTE: This is working for me but it's not the official solution (plus I ChatGpt'd the hell out of it). Use at your own risk.
There are 2 issues:
1) The script on raisely local
targets the URL using yourcampaing.raisely.com which redirects to yourcampaing.raiselysite.com preventing the proxy interception.
FIX (Pull request sent):
C:\Users\<YOUR_USER_NAME>\AppData\Roaming\npm\node_modules\@raisely
@raisely\cli\src
and open the file "local.js"https://${campaign.path}.raisely.com
for https://${campaign.path}.raiselysite.com
That will stop the redirect, and running raisely local
will actually open your localhost, but you'll see weird codes. That's because the content is compressed with zstd, which is the second issue
2) Response to intercept is compressed with zstd FIX: This fix has 2 parts, installing zstd on your computer and adding a library/code to the Raisely CLI project
@raisely\cli\
and run npm i simple-zstd
(Source)After installing it, go back to the local.js file and replace the line 142 that currently should looks like this:
const response = responseBuffer.toString('utf8'); // convert buffer to string
for this:
const response = await new Promise((resolve, reject) => {
const decompressedChunks = [];
const decompressStream = ZSTDDecompress();
decompressStream.on('data', (chunk) => decompressedChunks.push(chunk));
decompressStream.on('end', () => resolve(Buffer.concat(decompressedChunks).toString('utf8')));
decompressStream.on('error', reject);
decompressStream.end(responseBuffer);
});
import { ZSTDDecompress } from 'simple-zstd';
and SAVERun raisely local
again, and that should work now
I'm unable to get
raisely local
to work for the following reasons:raisely start
behaves)Any help with this issue would be appreciated. Thanks