-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FilePlayer not loaded #907
Comments
As of |
I use this npm module in the React.js application. Does it mean that I'm not able to import ReactPlayer in the react component? |
Please let me know how to support code-splitting/dynamic imports on react and gulp. |
@kingstar1227 does the problem occur in |
@cookpete it works well in 2.0.1. I think the main reason is that you load the FilePlayer component from this route './FilePlayer'. After the project is bundled, it doesn't import FileMaker from node_module, it is trying to import FilePlayer from dist directory. |
Yeah, the library that is bundling the project should see How exactly is |
@cookpete This is my gulp config. gulp.task('scripts', () => {
return gulp.src('app/static/scripts/**/*.js?(x)')
// .pipe($.cached('scripts'))
.pipe($.plumber())
.pipe($.sourcemaps.init())
.pipe($.babel({presets: ["@babel/preset-env", "@babel/preset-react"]}))
.pipe($.sourcemaps.write('.'))
.pipe(gulp.dest('.tmp/static/scripts'));
});
gulp.task('es6', gulp.series('typescripts', () => {
return browserify([
"./.tmp/static/scripts/app.js"],
{
debug: true,
})
.transform(babelify)
.bundle()
//
.pipe(source('app-bundle.js'))
.pipe(gulp.dest('./.tmp/static/scripts'))
.pipe(reload({stream: true}));
}));
gulp.task('serve', gulp.series('styles', 'scripts', 'es6', 'fonts', () => {
// sets up browser sync
// will proxy locally to 8080 (default backend port)
browserSync({
notify: false,
https: true,
ghostMode: false,
logLevel: "debug",
proxy: {
target: 'localhost:8080',
ws: true,
},
port: 8081,
host: 'local.agingchoices.com',
open: 'external',
cors: true,
serveStatic: [{
route: '/bower_components',
dir: './bower_components',
proxyRes: [
function (proxyRes, req, res) {
// console.log(proxyRes.headers);
// console.log(proxyRes);
// if proxy returns a redirect
if (proxyRes.statusCode === 302) {
// check if location is set
if (typeof proxyRes.headers.location !== 'undefined') {
// this will rewrite a location redirect to https as the proxy
// connection is over http and so browser sync will redirect to http
proxyRes.headers.location = proxyRes.headers.location.replace(
'http://', 'https://');
}
}
}
]
},
{
route: '/node_modules',
dir: './node_modules'
},
{
route: '/.tmp',
dir: ['./.tmp/']
},
{
route: '/static',
dir: ['./app/static']
},
]
});
} |
@kingstar1227 I'm hoping this works ok when using |
Fixes cookpete/react-player#912 Fixes cookpete/react-player#907 Fixes cookpete/react-player#865 Sort of fixes cookpete/react-player#910 Sort of fixes cookpete/react-player#902 Affects cookpete/react-player#886 Affects cookpete/react-player#738
Fixes cookpete/react-player#912 Fixes cookpete/react-player#907 Fixes cookpete/react-player#865 Sort of fixes cookpete/react-player#910 Sort of fixes cookpete/react-player#902 Affects cookpete/react-player#886 Affects cookpete/react-player#738
Fixes cookpete/react-player#912 Fixes cookpete/react-player#907 Fixes cookpete/react-player#865 Sort of fixes cookpete/react-player#910 Sort of fixes cookpete/react-player#902 Affects cookpete/react-player#886 Affects cookpete/react-player#738
Be sure to search for your issue before opening a new one.
Current Behavior
I bundled the app with gulp and it doesn't load FilePlayer from node_module. It's trying to load the FilePlayer from the dist directory.
Expected Behavior
Steps to Reproduce
Environment
Other Information
The text was updated successfully, but these errors were encountered: