Code Works in Preview but not in Published?

Get rid of the brackets in the import statement. Should be like this:

import wixData from 'wix-data';

Damn! Can’t believe I missed that. Brain fart.