question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] How to replace CDN urls from components' json files?

See original GitHub issue

Environment

Please provide as many details as you can:

  • Hosting type
    • [] Form.io
    • Local deployment, own backend
  • Formio.js version: 4.12.6
  • Frontend framework: React
  • Browser: Google Chrome
  • Browser version: Version 88.0.4324.150 (Official Build) (64-bit)

Issue details

We have recently been struggling to make FormIO (mostly FormBuilder) not using libraries loaded from external CDNs. Our environment allows only fetching files from localhost because of security policy. For some parts we managed applying solution from this item: https://github.com/formio/formio.js/issues/1649

This works fine for all libraries that are loaded using Formio.requireLibrary function. However, it turns out that there are some external files hard-coded in JSON files. Examples:

You can find these links inside files located in formio.js\src\components. For example the link https://cdn.form.io/timezones.json is placed directly in JSON definition in DateTime.edit.display.js. When using this DateTime component and expanding time zones list, the timezones.json file is fetched from cdn.form.io.

Is there any way to make these files loaded from localhost instead of using CDN? If not I guess it’s a bug, and it should be possible like with other libraries loaded using Formio.requireLibrary.

Thanks foryour help.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
benjamindammcommented, Dec 8, 2021

It’s a pity that Formio is so nailed down. Even if you find the right place in code its very hard to change certain things like the layout of editor modal or removing the cdn urls.

0reactions
heather-formiocommented, Oct 12, 2022

We are working on changes for the renderer to lazy load these libraries only as needed, and I am taking your feedback for consideration on our roadmap for how this is implemented to ease adoptability and implementation of any changes needed. I appreciate the feedback.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Google-CDN does not change the path to CDN leaves it at ...
One problem I found is that I have Angular set at ^1.5.0 in my bower.json. However, I was only using the default Google...
Read more >
Loading JSON data from Cloud Storage | BigQuery
To change how BigQuery parses JSON data, specify additional options in the Google Cloud console, the bq command-line tool, the API, or the...
Read more >
file-loader - webpack - JS.ORG
The file-loader resolves import / require() on a file into a url and emits the file into the output directory. Getting Started. To...
Read more >
AMP Cache URL Format and Request Handling
Domain Name Prefix. An AMP Cache serves documents on an altered URL, such as example-com.cdn.ampproject.org . The first dotted component ...
Read more >
Data Fetching: getStaticProps - Next.js
Fetch data and generate static pages with `getStaticProps`. ... generates HTML and JSON files, both of which can be cached by a CDN...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found