Code must be written inside the body of the class; if you read carefully the error message indicates the same.
we need to enable LWS under session settings. Setup -> Session Settings -> Enable "Use Lightning Web Security for Lightning web components and Aura components". Also please make sure your in VS code, org-api-version is 58.0 or above. You can check the same using
sf config list
Also, the meta-xml of your component should contain the capabilities property if you want to make use of dynamic instantiation
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>59.0</apiVersion>
<capabilities>
<capability>lightning__dynamicComponent</capability>
</capabilities>
</LightningComponentBundle>
change
@Salesforce/apex/WireApexDemo1.getoppo
to (small 's' since JS is case-sensitive):
@salesforce/apex/WireApexDemo1.getoppo
and as already been said check your java version:
LWC1702
I have got the same problem , solved the issue with forward slash
import { createElement } from "lwc/";
import { createElement } from '@lwc/engine-dom';
Adding this resolved the error for me.