Closed Jammy1299 closed 1 day ago
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.
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.
Are you encountering an error that looks something like this?
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
.
@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.
Did you manage to solve the issue?
I have updated my ngx-extended-pdf-viewer to version 19.4.1 and my angular application to version 16.
The ngx-extended-pdf-viewer is working fine in local. But when I am deploying this to environment I am getting this error.
And In network tab I can see this
extra assets label in adding in the URL.
I am using chrome browser.