Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with loadable #362

Closed
shavo007 opened this issue May 21, 2019 · 2 comments
Closed

Issue with loadable #362

shavo007 opened this issue May 21, 2019 · 2 comments

Comments

@shavo007
Copy link

Code splitting by route, get test failure

Summary of all failing tests
 FAIL  src/App/App.spec.js
  ● Test suite failed to run

    /Users/slee/projects/adv-account-management-ui/node_modules/sku/@loadable/component/index.ts:3
    import loadable, { loadableReady } from '@loadable/component';
           ^^^^^^^^

    SyntaxError: Unexpected identifier

      16 | import UnhandledErrorPage from './UnhandledErrorPage';
      17 | import { trackOnce } from 'src/utils/trackError';
    > 18 | import loadable from 'sku/@loadable/component';
         | ^
      19 | 
      20 | import {
      21 |   selectIsPendingActivation,

      at ScriptTransformer._transformAndBuildScript (node_modules/jest/node_modules/@jest/transform/build/ScriptTransformer.js:471:17)
      at Object.<anonymous> (src/App/App.js:18:1)

sku version 8.5.0

@shavo007
Copy link
Author

sample usage in App.js


import loadable from 'sku/@loadable/component';



// code splitting by route
);
const LoadableNoMatchPage = loadable(() =>
  import(/* webpackChunkName: "nomatch-page"*/ './NoMatchPage'),
);


     <Switch>
                <Route component={LoadableNoMatchPage} />
              </Switch>

@shavo007
Copy link
Author

it works without sku prefix.

although #355 was going to change this behaviour but never got merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants