Dynamic loading of packages with react-pdf The 2019 Stack Overflow Developer Survey Results Are InLoop inside React JSXWhat do these three dots in React do?Programmatically navigate using react routerReact app crashes when loading Redux storeUnable to retrieve Redux StoreLoading external libraries in a SharePoint WebPartREACT PDF: Cannot use the packages to show static PDF fileReact loadable unable to load component on every new build unless refresh the pageCreate React Worker not found on serverenable to use reactstrap library in client side spfx

Does light intensity oscillate really fast since it is a wave?

Is three citations per paragraph excessive for undergraduate research paper?

How was Skylab's orbit inclination chosen?

Monty Hall variation

"What time...?" or "At what time...?" - what is more grammatically correct?

Is domain driven design an anti-SQL pattern?

Limit the amount of RAM Mathematica may access?

Are there any other methods to apply to solving simultaneous equations?

What is a mixture ratio of propellant?

Where to refill my bottle in India?

I see my dog run

What does Linus Torvalds means when he says that git "never ever" tracks a file?

If a poisoned arrow's piercing damage is reduced to 0, do you still get poisoned?

What does "sndry explns" mean in one of the Hitchhiker's guide books?

Access elements in std::string where positon of string is greater than its size

Lethal sonic weapons

Springs with some finite mass

Spanish for "widget"

Why is Grand Jury testimony secret?

How are circuits which use complex ICs normally simulated?

Realistic Alternatives to Dust: What Else Could Feed a Plankton Bloom?

What is this 4-propeller plane?

Falsification in Math vs Science

How to answer pointed "are you quitting" questioning when I don't want them to suspect



Dynamic loading of packages with react-pdf



The 2019 Stack Overflow Developer Survey Results Are InLoop inside React JSXWhat do these three dots in React do?Programmatically navigate using react routerReact app crashes when loading Redux storeUnable to retrieve Redux StoreLoading external libraries in a SharePoint WebPartREACT PDF: Cannot use the packages to show static PDF fileReact loadable unable to load component on every new build unless refresh the pageCreate React Worker not found on serverenable to use reactstrap library in client side spfx



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I added react-pdf inside my SharePoint online solution and create a new webpart.



As mentioned on documentation with react-pdf :




It is crucial for performance to use PDF.js worker whenever possible.
This ensures that PDF files will be rendered in a separate thread
without affecting page performance. To make things a little easier,
we've prepared several entry points you can use.




So i have imported react-js component as they said with webpack:



import Document from 'react-pdf/dist/entry.webpack';


When i build, my solution was sucessfully chunk as they speak on sharePoint docuementation here inisde /dist folder : https://docs.microsoft.com/en-us/sharepoint/dev/spfx/dynamic-loading



enter image description here



My webpart work perfectly locally but when i push my solution on my website and i try to display my webpart sharepoint can't access to worker file.



Error when I m on _layouts/15/workbench.aspx page:




[SPLoaderError.loadComponentError]:
Failed to load component "5749a310-3745-4f9e-b3b1-d80f6e26b2dc" (ListDocSeriesWebPart).
Original error: Failed to load entry point from component "5749a310-3745-4f9e-b3b1-d80f6e26b2dc" (ListDocSeriesWebPart).
Original error: Failed to construct 'Worker': Script at 'https://localhost:4321/dist/cb26e0c76f455dfdff94.worker.js' cannot be accessed from origin 'https://digitalsolution365.sharepoint.com'.




May be i have missing something inside config.json or may be it was not possible to do that ?! I didn't find any information, how to fix that.










share|improve this question






























    0















    I added react-pdf inside my SharePoint online solution and create a new webpart.



    As mentioned on documentation with react-pdf :




    It is crucial for performance to use PDF.js worker whenever possible.
    This ensures that PDF files will be rendered in a separate thread
    without affecting page performance. To make things a little easier,
    we've prepared several entry points you can use.




    So i have imported react-js component as they said with webpack:



    import Document from 'react-pdf/dist/entry.webpack';


    When i build, my solution was sucessfully chunk as they speak on sharePoint docuementation here inisde /dist folder : https://docs.microsoft.com/en-us/sharepoint/dev/spfx/dynamic-loading



    enter image description here



    My webpart work perfectly locally but when i push my solution on my website and i try to display my webpart sharepoint can't access to worker file.



    Error when I m on _layouts/15/workbench.aspx page:




    [SPLoaderError.loadComponentError]:
    Failed to load component "5749a310-3745-4f9e-b3b1-d80f6e26b2dc" (ListDocSeriesWebPart).
    Original error: Failed to load entry point from component "5749a310-3745-4f9e-b3b1-d80f6e26b2dc" (ListDocSeriesWebPart).
    Original error: Failed to construct 'Worker': Script at 'https://localhost:4321/dist/cb26e0c76f455dfdff94.worker.js' cannot be accessed from origin 'https://digitalsolution365.sharepoint.com'.




    May be i have missing something inside config.json or may be it was not possible to do that ?! I didn't find any information, how to fix that.










    share|improve this question


























      0












      0








      0








      I added react-pdf inside my SharePoint online solution and create a new webpart.



      As mentioned on documentation with react-pdf :




      It is crucial for performance to use PDF.js worker whenever possible.
      This ensures that PDF files will be rendered in a separate thread
      without affecting page performance. To make things a little easier,
      we've prepared several entry points you can use.




      So i have imported react-js component as they said with webpack:



      import Document from 'react-pdf/dist/entry.webpack';


      When i build, my solution was sucessfully chunk as they speak on sharePoint docuementation here inisde /dist folder : https://docs.microsoft.com/en-us/sharepoint/dev/spfx/dynamic-loading



      enter image description here



      My webpart work perfectly locally but when i push my solution on my website and i try to display my webpart sharepoint can't access to worker file.



      Error when I m on _layouts/15/workbench.aspx page:




      [SPLoaderError.loadComponentError]:
      Failed to load component "5749a310-3745-4f9e-b3b1-d80f6e26b2dc" (ListDocSeriesWebPart).
      Original error: Failed to load entry point from component "5749a310-3745-4f9e-b3b1-d80f6e26b2dc" (ListDocSeriesWebPart).
      Original error: Failed to construct 'Worker': Script at 'https://localhost:4321/dist/cb26e0c76f455dfdff94.worker.js' cannot be accessed from origin 'https://digitalsolution365.sharepoint.com'.




      May be i have missing something inside config.json or may be it was not possible to do that ?! I didn't find any information, how to fix that.










      share|improve this question
















      I added react-pdf inside my SharePoint online solution and create a new webpart.



      As mentioned on documentation with react-pdf :




      It is crucial for performance to use PDF.js worker whenever possible.
      This ensures that PDF files will be rendered in a separate thread
      without affecting page performance. To make things a little easier,
      we've prepared several entry points you can use.




      So i have imported react-js component as they said with webpack:



      import Document from 'react-pdf/dist/entry.webpack';


      When i build, my solution was sucessfully chunk as they speak on sharePoint docuementation here inisde /dist folder : https://docs.microsoft.com/en-us/sharepoint/dev/spfx/dynamic-loading



      enter image description here



      My webpart work perfectly locally but when i push my solution on my website and i try to display my webpart sharepoint can't access to worker file.



      Error when I m on _layouts/15/workbench.aspx page:




      [SPLoaderError.loadComponentError]:
      Failed to load component "5749a310-3745-4f9e-b3b1-d80f6e26b2dc" (ListDocSeriesWebPart).
      Original error: Failed to load entry point from component "5749a310-3745-4f9e-b3b1-d80f6e26b2dc" (ListDocSeriesWebPart).
      Original error: Failed to construct 'Worker': Script at 'https://localhost:4321/dist/cb26e0c76f455dfdff94.worker.js' cannot be accessed from origin 'https://digitalsolution365.sharepoint.com'.




      May be i have missing something inside config.json or may be it was not possible to do that ?! I didn't find any information, how to fix that.







      reactjs webpack build sharepoint-online chunks






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 8 at 8:40







      volty41

















      asked Mar 8 at 8:32









      volty41volty41

      125




      125






















          0






          active

          oldest

          votes












          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55059367%2fdynamic-loading-of-packages-with-react-pdf%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55059367%2fdynamic-loading-of-packages-with-react-pdf%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          AWS Lex not identifying response if by a variable The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) The Ask Question Wizard is Live! Data science time! April 2019 and salary with experienceEnforcing custom enumeration in AWS LEX for slot valuesHow to give response based on user response in Amazon Lex?Intercepting AWS Lambda Response to a AWS Lex QueryLex chat bot error: Reached second execution of fulfillment lambda on the same utteranceamazon lex showing invalid responseLambda response send back to Lex slot?Response card in Amazon lexAmazon Lex - Lambda response return HTML to botHow can I solve 424 (Failed Dependency) (python) obtained from Amazon lex?

          Алба-Юлія

          Захаров Федір Захарович