Luceeforms not defined

On my client’s server (Windows) I also do some developing. One simple form webpage uses CFForm and CFInput. When I run this page directly on the server using localhost, CFForm works as expected - but when I run the same page using the domain name, it doesn’t work - the browser console shows the message “Uncaught ReferenceError: LuceeForms is not defined”.
What could be wrong here? some misconfiguration? some rights problem?

Never used cfform or any of the related cfml forms, so this is a shot into the dark: I know the cfform functionality comes with an extension you might need to install. Did you install the extension globally in the server admin or in the web admin of localhost? In case you’ve installed them in the web admin of localhost, then it will probably be missing in the web context of the domain name. You’d need to install it there too.

I didn’t install anything on this server :slight_smile: so I don’t know but I’ll check this first thing tomorrow. Thanks!

@veloopity Isn’t this the same thing you posted about on the ColdFusion programmers facebook group. I did suggest you ask here, but I also gave you some specific things to troubleshoot and I’m unclear if you actually took my advice. If you did, you didn’t mention it here as steps you’ve already taken.

hi Brad, yes, the same issue. I followed your advice and came here :slight_smile: the network tab in the browser console that you recommended to look at doesn’t tell me much. It rather seems to be some kind of mapping problem but I don’t quite understand it so far.
I made a tiny CFForm test program so you can look for yourself (the console error pops up on loading the page):
https://www.investmentfonds.de/cfformtest.cfm
This domain points to an “investmentfonds” subfolder underneath wwwroot. Lucee looks for its formtag files needed for CFForm in a Lucee subfolder underneath that subfolder: The console message says " Loading failed for the with source “https://www.investmentfonds.de/lucee/formtag-form.cfm”.
But Lucee’s WEB-INF folder lies directly underneath wwwroot, not under the “investmentfonds” subfolder. I think that the problem lies here but I’m not sure what to tweak.

reckon you have the /lucee folder locked down (which is good), so it doesn’t work

my advice? don’t ever use cfform, cfinput or any other of the old crappy ajax stuff

aside, /WEB-INF should always be blocked anyway as per the lockdown guide

don’t ever use cfform, cfinput or any other of the old crappy ajax stuff

even after relaunch, this website contains lots of legacy code which won’t go away anytime soon. So I don’t have this option to ‘don’t ever use’

I know your pain!

as per the docs, I haven’t tried it, but you can provide an alternate scriptsrc for that blocked js file?

you can provide an alternate scriptsrc for that blocked js file?

it works now. I just added an empty “lucee” folder into the root folder of the website, and copied “formtag-form.cfm” into it. Apparently, that was all

2 Likes

That’s fine, but seeing you ask the same question you did on facebook without appearing have looked at any of the advice I gave you days ago was odd.

Trust me, it contains very important information. If you don’t know where to look in the network tab or you can’t; make sense of the information you see, then ask us to help you. Just ignoring it because it doesn’t seem useful to you is not helping.

You need to find the HTTP request to the JS file from Lucee for CFForm.

  • what is the URL?
  • what response is being returned from the server? (which tells us if it’s even reaching Lucee)

The JS file is now loading from your workaround so there is no console error and I can’t tell what the issue was. The URL /lucee/formtag-form.cfm is not a “real” path as far as your web server is concerned, but Lucee knows how to serve it.

This is not really correct. Lucee resolves all paths starting with /lucee to a Lucee Archive (lar) that is configured in the server admin under mappings. So while it may appear to be a subfolder in the browser’s URL, Lucee is using a CF mapping to resolve the actual file. This can confuse your web server since your web server will think the file is missing which can affect rewrites and proxies, but if the web server will simply pass the URL to Lucee, then Lucee will know how to serve it.

That just means the contents of the file wasn’t valid JavaScript. You needed to look at the actual contents of that file that was coming back to get clues about where it had gotten rewritten to or what the web server had returned (like a 404, etc) You can do that by selecting the file in the network tab (filter by JS), and choosing the “preview” or “response” tab. Or, you could have right clicked on the URL and chosen “open in new tab” to open your browser directly to that file and see what is coming back.

This has nothing at all to do with the issue. The /lucee CF Mapping that serves that file is configured inside of Lucee, but the location of the web-inf has no bearing on this.

The web-inf is a red herring. Ignore it, and focus on why the URL is not being proxied as-is from the web server for Lucee to handle. As Zac said, it could even be an overzealous sys admin who blocked the entire /lucee folder instead of just the /lucee/admin folder like he should have. There are many possibilities, but again you need to find out what is being served for that file and why, which is what I suggested 2 days ago on the facebook post.

Hello.

I’m having the same issue:
Uncaught ReferenceError: LuceeForms is not defined

Using the network tab, I can see Lucee making a HTTP request for CF From to:
https://[URL]/lucee/formtag-form.cfm which returns a 403 error.

2024-01-05 11:38:22 10.100.3.4 GET /lucee/formtag-form.cfm - 443 - 86.22.132.242 Mozilla/5.0+(Macintosh;+Intel+Mac+OS+X+10_15_7)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/120.0.0.0+Safari/537.36 - 403 503 5 16

I’ve checked and the entire /lucee directory is not being locked down just /lucee/admin so I don’t why the 403 is still kicking in.

Any ideas?

Have you installed the cfform extension?

https://download.lucee.org/#FAD67145-E3AE-30F8-1C11A6CCF544F0B7

1 Like

Hello. It’s definitely installed.

Looks like you are using IIS. That log entry shows the 403 error, which is the “forbidden” error that you see. But that ‘503’ reported next to it in the log file is the sub-error. That is telling you that the restriction is occurring because of some IP restriction module in IIS. I think you have set some sort of IP address restrictions on IIS and that is why it is being blocked.

In IIS manager, click on the web site, then click on IP Address and Domain Restrictions to see what is set there. It might be set to ‘deny’ requests.

Hello. Yes, I’m using IIS.

The /lucee/ directory has entry in IP Address and Domain restrictions:

Allow 127.0.0.1 Local

I have tried removing this but same result.

Per the log entry you shared above, you are not navigating to the site on local host (127.0.0.1). You need to check the default setting for IP Address and Domain restrictions. You will see it under ‘Edit Feature Settings’. I am assuming default is set to ‘deny’. As such, only IP addresses that you set to ‘allow’ will have permissions. Like you had set for local host (127.0.0.1)

WARNING: if you change this default setting from ‘deny’ to ‘allow’ you will be removing the security all together. From a whitelist to a blacklist. You need to be aware of how this is working and what you are trying to do. You can set these permissions at the folder level as well. So at least you are only allowing more at the specific folder level where you need it.

Read more about it here -
https://learn.microsoft.com/en-us/iis/get-started/whats-new-in-iis-8/iis-80-dynamic-ip-address-restrictions

1 Like