-
Notifications
You must be signed in to change notification settings - Fork 8
./node_modules/forge-dataviz-iot-react-components/client/components/BasicTree.jsx 107:16 loaders error? #4
Comments
it is not possible to include the package https://www.npmjs.com/package/forge-dataviz-iot-react-components inside a react project made with npx create-react-app (hoping Autodesk is going to fix this problem soon). You need to edit one line about ...
alias: {
'PIXI': "pixi.js/",
// Support React Native Web
// https://www.smashingmagazine.com/2016/08/a-glimpse-into-the-future-with-react-native-for-web/
'react-native': 'react-native-web',
// Allows for better profiling with ReactDevTools
...(isEnvProductionProfile && {
'react-dom$': 'react-dom/profiling',
'scheduler/tracing': 'scheduler/tracing-profiling',
}),
...(modules.webpackAliases || {}),
},
... and another part about ...
module: {
strictExportPresence: true,
rules: [
// Disable require.ensure as it's not a standard language feature.
{ parser: { requireEnsure: false } },
{
// "oneOf" will traverse all following loaders until one will
// match the requirements. When no loader matches it will fall
// back to the "file" loader at the end of the loader list.
oneOf: [
{
test: /forge-dataviz-iot-react-component.*.jsx?$/,
use: [
{
loader: require.resolve('babel-loader'),
options: {
presets: ["@babel/react", ["@babel/env", { "targets": "defaults" }]],
plugins: ["@babel/plugin-transform-spread"]
}
},
],
exclude: path.resolve(__dirname, "node_modules", "forge-dataviz-iot-react-components", "node_modules"),
},
// TODO: Merge this config once `image/avif` is in the mime-db
// https://github.com/jshttp/mime-db
{
test: [/\.avif$/],
loader: require.resolve('url-loader'),
options: {
limit: imageInlineSizeLimit,
mimetype: 'image/avif',
name: 'static/media/[name].[hash:8].[ext]',
},
},
... after that on Although you will not see any other errors, the package will not work. |
please don't leave the issue as it is |
I actually don't think this is an issue with either create react app or webpack. The After making the following changes to the package.json, I was able to fix this issue locally.
The addition of the files property is not essential but does prevent cluttering up the published package contents with resources which are not required. As a workaround, change the import of any of the package components to target the bundle in dist. For example:
I did also experience another error at first and had to downgrade to react v16.14.0 |
simply including
import { Viewer } from "forge-dataviz-iot-react-components";
in a empty new react project (npx create-react-app) I get this:Any idea how to fix according with the suggestion on https://webpack.js.org/concepts#loaders ?
The text was updated successfully, but these errors were encountered: