Code Monkey home page Code Monkey logo

Comments (5)

agrube avatar agrube commented on August 20, 2024 1

Are you encountering an error that looks something like this?

image

If so, you're having a CORS issue on your production server that is blocking the worker file. Make sure your worker-src is defined and specifies 'self' so it doesn't attempt to fall back onto the child-src.

from ngx-extended-pdf-viewer.

stephanrauh avatar stephanrauh commented on August 20, 2024 1

@Jammy1299 The issue happens in only production because you're using a different server in production. Usually, you also have a firewall and other security measures in production. When you say it works again after downgrading, you'll want to check whether your server has a problem with *.mjs files. On the other hand, that's unlikely because the other JavaScript files are loaded correctly.

from ngx-extended-pdf-viewer.

stephanrauh avatar stephanrauh commented on August 20, 2024

Yes, there's an extra assets/ in the URL when the viewer tries to load the worker into the main thread. But it should never reach that line. So let's focus on the first attempt to load it. Your screenshot says the file is blocked. Blocked by what?

BTW, a workaround is to load the pdf.worker*.mjs yourself. For instance, you can add a <script> tag to the index.html. However, that's not a good solution because it costs performance and because the version number of the file changes with every release.

from ngx-extended-pdf-viewer.

Jammy1299 avatar Jammy1299 commented on August 20, 2024

I have downgraded to version 18.1.14 and now Its working with my angular version 16.
Can we make it to work with version 19 or 20?
Also why this issue only coming in production but not in local.

from ngx-extended-pdf-viewer.

stephanrauh avatar stephanrauh commented on August 20, 2024

Did you manage to solve the issue?

from ngx-extended-pdf-viewer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.