Posted 7 January 2025, 5:57 am EST
- Updated 7 January 2025, 6:03 am EST
Hi Sabih,
>> just viewed the report in newer version and ive noticed abrupt line breaking whn going to next page is there any setting i can do to avoid this
This issue seems to exist only with the latest version. We have escalated the issue to our development team and will update you soon as we hear anything from them. [Internal tracking ID: ARJ-6629]
>> I have updated my package and import , im using node v 16.20.2…
We were able to run our application successfully with node v16.20.2 as well.
It seems that you are using a React native app without Next.js or Vite frameworks. The modern way to create a React app is to use frameworks like Vite or Next.js, which offer more comprehensive features and improved performance. You may refer to the previously shared documentation links for creating ActiveReportsJS Report Designer/Viewer applications with React.
For the React Native apps, you can use the workaround with Craco (Craco supports the latest version of react-scripts, unlike react-script-rewired). After initiating CRA and installing activereports dependencies, you need to create craco config. Put the following code to craco.config.js:
const modifyOneOfRules = (rules) => {
return rules.map(rule => {
if (rule.oneOf instanceof Array) {
const lastOneOfRule = rule.oneOf[rule.oneOf.length - 1];
lastOneOfRule.exclude = [
/\.(js|mjs|jsx|cjs|ts|tsx)$/,
/\.html$/,
/\.json$/,
];
}
return rule;
})
};
const createFullySpecifiedRule = () => ({
test: /\.m?js$/,
resolve: {
fullySpecified: false,
},
});
module.exports = {
webpack: {
configure: config => ({
...config,
module: {
...config.module,
rules: [
...modifyOneOfRules(config.module.rules),
createFullySpecifiedRule()
],
},
}),
},
};
Also, replace the react-scripts with craco in the package.json:
{
"name": "arjs-react-viewer-app",
"version": "0.1.0",
"private": true,
"dependencies": {
"@mescius/activereportsjs": "5.1.5",
"@mescius/activereportsjs-react": "5.1.5",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-scripts": "5.0.1",
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "craco start",
"build": "craco build",
"test": "craco test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"@craco/craco": "^7.1.0"
}
}
Please note that while switching from react-scripts/react-scripts-rewired to craco in an existing project, make sure to remove the cache from the node_modules before starting the project to avoid the
Failed to compile. Attempted import error: 'Core' is not exported from '@mescius/activereportsjs' (imported as 'Core').
error.
If the issue persists, please share with us your sample application replicating the issue so that we can assist you accordingly.
Attachments:arjs5.1.5_with_react_workaround.zip