Packing socketio client with webpack causes warning about no src\index.ts? #4209
-
I'm trying to package socket.io-client with webpack but its spitting out a warning. Seems to work, but I want to know why the warning is occuring.
Its complaining that it cant find a typescript file in the src package. I checked my node_modules folder, and I do not have a src module. Installing 'src' from npm doesnt fix it. Is this the package its looking for? https://www.npmjs.com/package/src The line of code that's causing this warning is just an import of socket.io-client:
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
Hi! I was not able to reproduce the issue. Could you please provide your complete webpack configuration? Update: I could in fact reproduce, please check there: niklasvh/base64-arraybuffer#32 |
Beta Was this translation helpful? Give feedback.
-
Here is my webpack config. I did just add the ignoreWarnings flag for source maps which has silenced it and is good enough for me to close this unless you have any ideas.
This might also be better off as an issue in the source-map-loader repo? Didn't realize it was generated from that module at the time and forgot I posted an issue. |
Beta Was this translation helpful? Give feedback.
-
I saw this in my console when updating this tutorial today and using the
latest version of Create React App.
https://developer.okta.com/blog/2021/07/14/socket-io-react-tutorial
…On Wed, Dec 15, 2021 at 15:01 joe Jankowiak ***@***.***> wrote:
Here is my webpack config. I did just add the ignoreWarnings flag for
source maps which has silenced it and is good enough for me to close this
unless you have any ideas.
import path from 'path';
import { fileURLToPath } from 'url';
// Plugins
import HtmlWebpackPlugin from 'html-webpack-plugin';
import CopyPlugin from 'copy-webpack-plugin';
import FaviconsWebpackPlugin from 'favicons-webpack-plugin';
const filename = fileURLToPath(import.meta.url);
const dirname = path.dirname(filename);
export default {
entry: {
app: path.resolve(dirname, 'app', 'index.js'),
},
plugins: [
new HtmlWebpackPlugin({
template: './app/template.html',
filename: 'index.html',
}),
new CopyPlugin({
patterns: [
{ from: './app/assets' },
],
}),
new FaviconsWebpackPlugin('./app/assets/svg/favico.svg'),
],
module: {
rules: [
{
test: /\.m?js/,
resolve: {
fullySpecified: false,
},
},
{
test: /\.css$/i,
use: ['style-loader', 'css-loader'],
},
{
test: /\.jsx?$/,
exclude: ***@***.***))/,
loader: 'babel-loader',
},
{
test: /\.js$/,
enforce: 'pre',
use: ['source-map-loader'],
},
],
},
resolve: {
modules: [path.resolve(dirname, './app/'), path.resolve('./node_modules')],
},
ignoreWarnings: [/Failed to parse source map/],
};
This might also be better off as an issue in the source-map-loader repo?
Didn't realize it was generated from that module at the time and forgot I
posted an issue.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#4209 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAELZHSWOIUUPOQD4MVWFTUREF5FANCNFSM5JVKDFTA>
.
|
Beta Was this translation helpful? Give feedback.
-
OK, I was finally able to reproduce, thanks 👍 This should be fixed by socketio/base64-arraybuffer@d30e7cc, included in |
Beta Was this translation helpful? Give feedback.
OK, I was finally able to reproduce, thanks 👍
This should be fixed by socketio/base64-arraybuffer@d30e7cc, included in
engine.io-parser@5.0.3
(and thus in latest socket.io-client, as it is a transitive dependency).