This question is essentially a follow-up to this question. I have been trying to follow Alchemy documentation to create an NFT contract but encountered the need (as described in the linked question) to import ERC721URIStorage. However, I now get a number of compilation problems that do not make clear sense to me.
In response to the first error (see below), I have tried adding in the import statement for ERC721: import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
This did not change anything in the set of compilation errors.
I was able to get the code to work with a slight variation. The relevant points of confusion seem to be:
I think the first two of these points are intuitive (they are the first thing I tried and appear in the code shown in the question). This is because ERC721URIStorage inherits from ERC721, so there is no need to explicitly import ERC721 or define the contract as such.
The third point was less expected, but in hindsight, I think the constructor must cite ERC721 because ERC721URIStorage does not have a constructor of its own and because there is ambiguity about where a constructor can be inherited from (either from a parent of ERC721URIStorage or from Ownable).
Below is the working contract: