2

enter image description hereMy React Chrome extension does not appear on my React web app, even though I've got it reading all the components, rendering it all correctly. Everything is coming out as an iframe (screenshot attached).

Here is my webpack.config.js file.

var path = require('path');
var webpack = require('webpack');

    module.exports = {
    entry: './main.js', 
    output: {path: __dirname, filename: 'bundle.js'}, 
    module: {
        loaders: [
            {
                test: /\.jsx?$/, 
                loader: 'babel-loader', 
                exclude: /node_modules/,
                query: {
                    presets: ['es2015', 'react']
                }
            }, 
            {
                test: /\.css$/, 
                loader: 'style!css' 
            }, 
            {
                test: require.resolve('react'),
                loader: 'expose?React'  
            }
        ]
    },
    plugins: [
        new webpack.NoErrorsPlugin()
    ], 
    watch: true

    };

My version of React, I believe 0.14.7, react-dom is 0.14.0. I also tried manipulating the main.js file which is the entry point.

I have

if (typeof window !== 'undefined') {
    window.React = React;
}

Could use any suggestions or help.

2 Answers 2

6

After some digging... wow it's super dumb. Instead of going to http://localhost:8080/webpack-dev-server/ , I went to just localhost:8080 and then I saw my React tab.

Sign up to request clarification or add additional context in comments.

1 Comment

The app is rendered in an iframe when route under /webpack-dev-server/ by removing it, live reload is not available anymore.
2

Is your app rendering in an iframe?

According to the react-devtools docs

Currently iframes and Chrome apps/extensions are not inspectable.

3 Comments

It did not change.
Are you rendering your app in an iframe? React-devtools says it can't communicate with an app inside an iframe
I am not rendering my app in in iframe. That's why I'm perplexed. My index.html <body> <div id="root"> </div> <script src="bundle.js"></script> </body>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.