Hi, @forge/ui was replaced by @forge/react and @forge/react does not have useAction. When I use below code I get run time error “(0 , e.useAction) is not a function or its return value is not iterable”.
import ForgeReconciler, {
Text,
Em,
useProductContext,
Textfield,
Form,
Button,
FormSection,
FormFooter,
Label,
RequiredAsterisk,
useForm,
DynamicTable,
Link,
Stack,
RadioGroup,
useAction
} from “@forge/react”;
const [filterValue] = useAction(value => value, async () => await getFilterValue());
When I change to @forge/ui I get the below error on forge deploy.
Error: Bundling failed: Module not found: Error: Can’t resolve ‘buffer’ in ‘C:......\node_modules\safe-buffer’
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.
If you want to include a polyfill, you need to:
- add a fallback ‘resolve.fallback: { “buffer”: require.resolve(“buffer/”) }’
- install ‘buffer’
If you don’t want to include a polyfill, you can use an empty module like this:
resolve.fallback: { “buffer”: false }
Regards,
AP