Flutter Script error for reusable component

Hi,

I attempted testing the latest version of the mobile shell (thanks for updating the documentation !), and I encountered the following error :

This comes through on iOS as the following:

image

And on Android:

image

Here are the errors I get for iOS:

flutter: load stopped: file:///Users/user/Library/Developer/CoreSimulator/Devices/30678F6D-282B-4C5E-85E7-F403F5072416/data/Containers/Bundle/Application/E1E24372-029E-4DAB-AF3B-343F2834BD1B/Runner.app/Frameworks/App.framework/flutter_assets/assets/ui_builder_app/index.html

flutter: type: {initiatorType: script, url: https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js, startTime: 11.0, duration: 435.0}

flutter: progress: 100

flutter: {message: Error: Script error for "components/reusable/r_b30cb13c8b87773cbf836fe6de8165e9/logic/5978e8c48b81407cc74e596f11d79894/bundle.js"

https://requirejs.org/docs/errors.html#scripterror, messageLevel: 3}

And for Android:

I/flutter ( 8261): load stopped: file:///android_asset/flutter_assets/assets/ui_builder_app/index.html

I/flutter ( 8261): progress: 100

E/AndroidProtocolHandler( 8261): Unable to open asset URL: file:///android_asset/flutter_assets/assets/ui_builder_app/components/reusable/r_b30cb13c8b87773cbf836fe6de8165e9/logic/5978e8c48b81407cc74e596f11d79894/bundle.js

E/AndroidProtocolHandler( 8261): Unable to open asset URL: file:///android_asset/flutter_assets/assets/ui_builder_app/components/reusable/r_b30cb13c8b87773cbf836fe6de8165e9/logic/2d3dd14ea4db23bb0032c084b558c957/bundle.js

E/AndroidProtocolHandler( 8261): Unable to open asset URL: file:///android_asset/flutter_assets/assets/ui_builder_app/components/reusable/r_b30cb13c8b87773cbf836fe6de8165e9/logic/27cb7ed82039e4988c6413948c2472ac/bundle.js

E/AndroidProtocolHandler( 8261): Unable to open asset URL: file:///android_asset/flutter_assets/assets/ui_builder_app/components/reusable/r_d8b8edc438e6edf6e969ae6548de5544/logic/c1380e865f08d4b8f2e87ebbc862a9d8/bundle.js

E/AndroidProtocolHandler( 8261): Unable to open asset URL: file:///android_asset/flutter_assets/assets/ui_builder_app/components/reusable/r_d8b8edc438e6edf6e969ae6548de5544/logic/89483cc85a88766c23181d5868c39dac/bundle.js

E/AndroidProtocolHandler( 8261): Unable to open asset URL: file:///android_asset/flutter_assets/assets/ui_builder_app/components/reusable/r_d8b8edc438e6edf6e969ae6548de5544/logic/7ff8907bdf55db1b26415ab8d9581e68/bundle.js

E/AndroidProtocolHandler( 8261): Unable to open asset URL: file:///android_asset/flutter_assets/assets/ui_builder_app/components/reusable/r_d8b8edc438e6edf6e969ae6548de5544/logic/45448838d5ea0218edaff8c811f88678/bundle.js

E/AndroidProtocolHandler( 8261): Unable to open asset URL: file:///android_asset/flutter_assets/assets/ui_builder_app/components/reusable/r_d8b8edc438e6edf6e969ae6548de5544/logic/026dcb2f7e68921c2db8c00847072027/bundle.js

E/AndroidProtocolHandler( 8261): Unable to open asset URL: file:///android_asset/flutter_assets/assets/ui_builder_app/components/reusable/r_d8b8edc438e6edf6e969ae6548de5544/logic/82e34a5881184c8ec9ac2788ab586238/bundle.js

E/AndroidProtocolHandler( 8261): Unable to open asset URL: file:///android_asset/flutter_assets/assets/ui_builder_app/components/reusable/r_d8b8edc438e6edf6e969ae6548de5544/logic/1d31e298a4b5cf369a08b658be88c918/bundle.js

I/flutter ( 8261): type: {initiatorType: script, url: file:///android_asset/flutter_assets/assets/ui_builder_app/components/reusable/r_b30cb13c8b87773cbf836fe6de8165e9/logic/5978e8c48b81407cc74e596f11d79894/bundle.js, startTime: 438.1000000000058, duration: 10.799999999988358}

I/flutter ( 8261): type: {initiatorType: script, url: file:///android_asset/flutter_assets/assets/ui_builder_app/components/reusable/r_b30cb13c8b87773cbf836fe6de8165e9/logic/2d3dd14ea4db23bb0032c084b558c957/bundle.js, startTime: 441.0, duration: 9.299999999988358}

I/flutter ( 8261): type: {initiatorType: script, url: file:///android_asset/flutter_assets/assets/ui_builder_app/components/reusable/r_b30cb13c8b87773cbf836fe6de8165e9/logic/27cb7ed82039e4988c6413948c2472ac/bundle.js, startTime: 441.3999999999942, duration: 9.0}

I/flutter ( 8261): type: {initiatorType: script, url: file:///android_asset/flutter_assets/assets/ui_builder_app/components/reusable/r_d8b8edc438e6edf6e969ae6548de5544/logic/c1380e865f08d4b8f2e87ebbc862a9d8/bundle.js, startTime: 441.70000000001164, duration: 8.699999999982538}

I/flutter ( 8261): {message: Error: Script error for "components/reusable/r_b30cb13c8b87773cbf836fe6de8165e9/logic/5978e8c48b81407cc74e596f11d79894/bundle.js"

I/flutter ( 8261): https://requirejs.org/docs/errors.html#scripterror, messageLevel: 3}

I/flutter ( 8261): type: {initiatorType: script, url: file:///android_asset/flutter_assets/assets/ui_builder_app/components/reusable/r_d8b8edc438e6edf6e969ae6548de5544/logic/89483cc85a88766c23181d5868c39dac/bundle.js, startTime: 441.79999999998836, duration: 8.700000000011642}

I/flutter ( 8261): type: {initiatorType: script, url: file:///android_asset/flutter_assets/assets/ui_builder_app/components/reusable/r_d8b8edc438e6edf6e969ae6548de5544/logic/7ff8907bdf55db1b26415ab8d9581e68/bundle.js, startTime: 441.8999999999942, duration: 8.60000000000582}

I/flutter ( 8261): type: {initiatorType: script, url: file:///android_asset/flutter_assets/assets/ui_builder_app/components/reusable/r_d8b8edc438e6edf6e969ae6548de5544/logic/45448838d5ea0218edaff8c811f88678/bundle.js, startTime: 441.8999999999942, duration: 8.700000000011642}

I/flutter ( 8261): type: {initiatorType: script, url: file:///android_asset/flutter_assets/assets/ui_builder_app/components/reusable/r_d8b8edc438e6edf6e969ae6548de5544/logic/026dcb2f7e68921c2db8c00847072027/bundle.js, startTime: 442.1000000000058, duration: 8.5}

I/flutter ( 8261): type: {initiatorType: script, url: file:///android_asset/flutter_assets/assets/ui_builder_app/components/reusable/r_d8b8edc438e6edf6e969ae6548de5544/logic/82e34a5881184c8ec9ac2788ab586238/bundle.js, startTime: 442.1000000000058, duration: 8.5}

I/flutter ( 8261): type: {initiatorType: script, url: file:///android_asset/flutter_assets/assets/ui_builder_app/components/reusable/r_d8b8edc438e6edf6e969ae6548de5544/logic/1d31e298a4b5cf369a08b658be88c918/bundle.js, startTime: 442.29999999998836, duration: 9.0}

I did declare reusable components as directed in the documentation, though:

image

Any pointers as to what could be wrong ? Thanks

Hello @Nicolas_REMY

Thanks for the message. We apologize for the inconvenience. We will investigate the problem and get back to you as soon as possible. Internal ticket for the issue - BKNDLSS-28152.

Regards,
Inna

Hello, @Nicolas_REMY.

We are already looking into your issue. When there is any result, I will let you know.

Best Regards, Nikita.

Great, thank you.

We have investigated the problem.

Unfortunately Flutter ignores all subfolders. Therefore, they need to be added manually, perhaps this is not very convenient, but so far this is the only way :frowning:
It will look like this for your project:

    - images/
    - assets/notification_sounds/push_sound.wav
    - assets/ui_builder_app/
    - assets/ui_builder_app/library/sdk/sdk.js
    - assets/ui_builder_app/components/reusable/r_7f7f5e2611cbfa01a216d2d8c0a70ec2/
    - assets/ui_builder_app/components/reusable/r_7f7f5e2611cbfa01a216d2d8c0a70ec2/logic/
    - assets/ui_builder_app/components/reusable/r_7f7f5e2611cbfa01a216d2d8c0a70ec2/logic/3d1ee424455a53a5b4b470b9f8ab6961/
    - assets/ui_builder_app/components/reusable/r_7f7f5e2611cbfa01a216d2d8c0a70ec2/logic/8fba6b063175d0240917d0ca8f6962c9/
    - assets/ui_builder_app/components/reusable/r_7f7f5e2611cbfa01a216d2d8c0a70ec2/logic/18764b8d5d93a49b846a9451069d8691/
    - assets/ui_builder_app/components/reusable/r_7f7f5e2611cbfa01a216d2d8c0a70ec2/logic/a4213df6a3a6efc5479c477ad9b1940c/
    - assets/ui_builder_app/components/reusable/r_7f7f5e2611cbfa01a216d2d8c0a70ec2/logic/b59957ad816d079288aeb38c92686a44/
    - assets/ui_builder_app/components/reusable/r_b30cb13c8b87773cbf836fe6de8165e9/
    - assets/ui_builder_app/components/reusable/r_b30cb13c8b87773cbf836fe6de8165e9/logic/
    - assets/ui_builder_app/components/reusable/r_b30cb13c8b87773cbf836fe6de8165e9/logic/2d3dd14ea4db23bb0032c084b558c957/
    - assets/ui_builder_app/components/reusable/r_b30cb13c8b87773cbf836fe6de8165e9/logic/27cb7ed82039e4988c6413948c2472ac/
    - assets/ui_builder_app/components/reusable/r_b30cb13c8b87773cbf836fe6de8165e9/logic/5978e8c48b81407cc74e596f11d79894/
    - assets/ui_builder_app/components/reusable/r_b30cb13c8b87773cbf836fe6de8165e9/logic/f1d9e60ea835cd78c9b99f22a952ee42/
    - assets/ui_builder_app/components/reusable/r_d8b8edc438e6edf6e969ae6548de5544/
    - assets/ui_builder_app/components/reusable/r_d8b8edc438e6edf6e969ae6548de5544/logic/
    - assets/ui_builder_app/components/reusable/r_d8b8edc438e6edf6e969ae6548de5544/logic/root/
    - assets/ui_builder_app/components/reusable/r_d8b8edc438e6edf6e969ae6548de5544/logic/1d31e298a4b5cf369a08b658be88c918/
    - assets/ui_builder_app/components/reusable/r_d8b8edc438e6edf6e969ae6548de5544/logic/7ff8907bdf55db1b26415ab8d9581e68/
    - assets/ui_builder_app/components/reusable/r_d8b8edc438e6edf6e969ae6548de5544/logic/026dcb2f7e68921c2db8c00847072027/
    - assets/ui_builder_app/components/reusable/r_d8b8edc438e6edf6e969ae6548de5544/logic/82e34a5881184c8ec9ac2788ab586238/
    - assets/ui_builder_app/components/reusable/r_d8b8edc438e6edf6e969ae6548de5544/logic/89483cc85a88766c23181d5868c39dac/
    - assets/ui_builder_app/components/reusable/r_d8b8edc438e6edf6e969ae6548de5544/logic/45448838d5ea0218edaff8c811f88678/
    - assets/ui_builder_app/components/reusable/r_d8b8edc438e6edf6e969ae6548de5544/logic/c1380e865f08d4b8f2e87ebbc862a9d8/

You can just copy and paste this into your assets in pubspec.yaml.

I will add information about ignoring subfolders to the native shell documentation, thanks.

Best Regards, Nikita.

Got it, thanks for investigating.
With this full folder tree, it works fine.

1 Like