Giter Site home page Giter Site logo

Comments (9)

santiagopuentep avatar santiagopuentep commented on August 16, 2024 2

Great! Glad I could help.

from meteor-hmr.

gadicc avatar gadicc commented on August 16, 2024 1

Thanks @santiagopuentep for helping out!!

@purplecones, the warning can be safely ignored, there's more about it in https://github.com/gadicc/meteor-hmr/blob/master/docs/Troubleshooting.md#react-issues.

I'm going to re-open this so I can add the workaround to the docs too.

from meteor-hmr.

santiagopuentep avatar santiagopuentep commented on August 16, 2024

Add localhost:3002 to your content security policy allowed domains.

BrowserPolicy.content.allowConnectOrigin("ws://localhost:3002/");

if you are using the browser-policy package.

from meteor-hmr.

purplecones avatar purplecones commented on August 16, 2024

Thanks @santiagopuentep for pointing that out! I didn't realize this package was added.
I'm using this https://themeteorchef.com/base/ boilerplate as a starting template.

However adding this doesn't seem to do anything:

import { BrowserPolicy } from 'meteor/browser-policy-common';
BrowserPolicy.content.allowConnectOrigin('ws://localhost:3002/');

I also tried BrowserPolicy.content.allowConnectOrigin('http://localhost'); but no change. Error still gets thrown.

from meteor-hmr.

purplecones avatar purplecones commented on August 16, 2024

Looking at the heads, this is what the browser sees. Not sure how to read this. Is the browser policy being applied?

content-security-policy:default-src 'self'; script-src 'self' 'unsafe-inline'; connect-src * 'self' http://localhost; img-src data: 'self'; style-src 'self' 'unsafe-inline';

application_name

from meteor-hmr.

santiagopuentep avatar santiagopuentep commented on August 16, 2024

Maybe with:

BrowserPolicy.content.allowConnectOrigin('http://localhost:3002');

Since you need to add the port too.

from meteor-hmr.

purplecones avatar purplecones commented on August 16, 2024

@santiagopuentep still no go even after adding port

import { BrowserPolicy } from 'meteor/browser-policy-common';
BrowserPolicy.content.allowConnectOrigin('http://localhost:3002');

:-(

from meteor-hmr.

purplecones avatar purplecones commented on August 16, 2024

This did it

BrowserPolicy.content.allowScriptOrigin('http://localhost:3002');

from meteor-hmr.

purplecones avatar purplecones commented on August 16, 2024

I do get this warning but it still works

modules.js?hash=2b7c6c6…:32749 Warning: [react-router] You cannot change <Router routes>; it will be ignoredwarning @ modules.js?hash=2b7c6c6…:32749routerWarning @ modules.js?hash=2b7c6c6…:29386Router_componentWillReceiveProps @ modules.js?hash=2b7c6c6…:30043updateComponent @ modules.js?hash=2b7c6c6…:15353receiveComponent @ modules.js?hash=2b7c6c6…:15285receiveComponent @ modules.js?hash=2b7c6c6…:8466_updateRenderedComponent @ modules.js?hash=2b7c6c6…:15489_performComponentUpdate @ modules.js?hash=2b7c6c6…:15467updateComponent @ modules.js?hash=2b7c6c6…:15386receiveComponent @ modules.js?hash=2b7c6c6…:15285receiveComponent @ modules.js?hash=2b7c6c6…:8466_updateRenderedComponent @ modules.js?hash=2b7c6c6…:15489_performComponentUpdate @ modules.js?hash=2b7c6c6…:15467updateComponent @ modules.js?hash=2b7c6c6…:15386receiveComponent @ modules.js?hash=2b7c6c6…:15285receiveComponent @ modules.js?hash=2b7c6c6…:8466_updateRenderedComponent @ modules.js?hash=2b7c6c6…:15489_performComponentUpdate @ modules.js?hash=2b7c6c6…:15467updateComponent @ modules.js?hash=2b7c6c6…:15386receiveComponent @ modules.js?hash=2b7c6c6…:15285receiveComponent @ modules.js?hash=2b7c6c6…:8466performUpdateIfNecessary @ modules.js?hash=2b7c6c6…:15297performUpdateIfNecessary @ modules.js?hash=2b7c6c6…:8499runBatchedUpdates @ modules.js?hash=2b7c6c6…:8075perform @ modules.js?hash=2b7c6c6…:8846perform @ modules.js?hash=2b7c6c6…:8846perform @ modules.js?hash=2b7c6c6…:8014flushBatchedUpdates @ modules.js?hash=2b7c6c6…:8101closeAll @ modules.js?hash=2b7c6c6…:8912perform @ modules.js?hash=2b7c6c6…:8859batchedUpdates @ modules.js?hash=2b7c6c6…:17152enqueueUpdate @ modules.js?hash=2b7c6c6…:8133enqueueUpdate @ modules.js?hash=2b7c6c6…:15774enqueueElementInternal @ modules.js?hash=2b7c6c6…:15958(anonymous function) @ modules.js?hash=2b7c6c6…:20012scrollMonitor @ modules.js?hash=2b7c6c6…:20000_updateRootComponent @ modules.js?hash=2b7c6c6…:20011_renderSubtreeIntoContainer @ modules.js?hash=2b7c6c6…:20106render @ modules.js?hash=2b7c6c6…:20154renderApp @ index.js:22(anonymous function) @ index.js:35canAccept @ hot.js:207requirersUntil @ hot.js:105requirersUntil @ hot.js:110requirersUntil @ hot.js:110hotWalker @ hot.js:162walkFileTree @ modules-runtime.js?hash=7fef6eb…&hot=1:497walkFileTree @ modules-runtime.js?hash=7fef6eb…&hot=1:501walkFileTree @ modules-runtime.js?hash=7fef6eb…&hot=1:501walkFileTree @ modules-runtime.js?hash=7fef6eb…&hot=1:501meteorInstallHot @ hot.js:159(anonymous function) @ hot.js?hash=015c726…:1

from meteor-hmr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.